diff options
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 21 |
1 files changed, 1 insertions, 20 deletions
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 |
