Dump cmap encodings
This commit is contained in:
21
app/Main.hs
21
app/Main.hs
@ -38,29 +38,10 @@ fontMain fontFile = do
|
||||
putStrLn $ "Dumping File:" <> fontFile <> "\n\n"
|
||||
|
||||
ttfContents <- ByteString.readFile fontFile
|
||||
|
||||
let initialState = Megaparsec.State
|
||||
{ stateInput = ttfContents
|
||||
, stateOffset = 0
|
||||
, statePosState = Megaparsec.PosState
|
||||
{ pstateInput = ttfContents
|
||||
, pstateOffset = 0
|
||||
, pstateSourcePos = Megaparsec.initialPos fontFile
|
||||
, pstateTabWidth = Megaparsec.defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
, stateParseErrors = []
|
||||
}
|
||||
(processedState, initialResult) = Megaparsec.runParser' fontDirectoryP initialState
|
||||
|
||||
case initialResult >>= dumpTrueType processedState of
|
||||
case dumpTrueType ttfContents fontFile of
|
||||
(Right fontDump) -> Text.Lazy.putStrLn $ Text.Builder.toLazyText fontDump
|
||||
Left e -> putStr (Megaparsec.errorBundlePretty e)
|
||||
{-
|
||||
let Just tableDirectory' = find (("OS/2" ==) . tag) $ tableDirectory directory
|
||||
tableResult = parseTable tableDirectory' os2TableP processedState
|
||||
case tableResult of
|
||||
Right x -> print x -}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
|
Reference in New Issue
Block a user