From 6923bceaa5c59fe959fd2c7dc1026be017c96526 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 12 Nov 2023 10:13:38 +0100 Subject: Dump cmap encodings --- app/Main.hs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'app/Main.hs') diff --git a/app/Main.hs b/app/Main.hs index 89a8dcd..c2c9787 100644 --- a/app/Main.hs +++ b/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 -- cgit v1.2.3