summaryrefslogtreecommitdiff
path: root/app/Main.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-11-12 10:13:38 +0100
committerEugen Wissner <belka@caraus.de>2023-11-12 10:13:38 +0100
commit6923bceaa5c59fe959fd2c7dc1026be017c96526 (patch)
tree2868cb5dfd8d330060871ab9873a24726015acc1 /app/Main.hs
parent1d4efb44bba9dc3dec416399554c3965f3dd628f (diff)
downloadfountainhead-6923bceaa5c59fe959fd2c7dc1026be017c96526.tar.gz
Dump cmap encodings
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs21
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