From 9a11ff5dd465cef33317ef6cc858f861956ade55 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 18 Nov 2023 04:40:17 +0100 Subject: Dump hmtx --- app/Main.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Main.hs b/app/Main.hs index c2c9787..23a86b9 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -15,7 +15,7 @@ import qualified Data.Text.Lazy as Text.Lazy import qualified Data.Text.Lazy.IO as Text.Lazy import qualified Data.Text.Encoding as Text import GHC.Records (HasField(..)) -import Graphics.Fountainhead.Dumper (dumpTrueType) +import Graphics.Fountainhead.Dumper (DumpError(..), dumpTrueType) -- TODO: kern table since format 1. -- For details on subtable format see examples in TrueType reference. import Graphics.Fountainhead.Parser @@ -40,8 +40,12 @@ fontMain fontFile = do ttfContents <- ByteString.readFile fontFile case dumpTrueType ttfContents fontFile of - (Right fontDump) -> Text.Lazy.putStrLn $ Text.Builder.toLazyText fontDump - Left e -> putStr (Megaparsec.errorBundlePretty e) + Right fontDump -> Text.Lazy.putStrLn $ Text.Builder.toLazyText fontDump + Left e + | DumpParseError bundle <- e -> putStr + $ Megaparsec.errorBundlePretty bundle + | DumpRequiredTableMissingError tableName <- e -> putStr + $ "Required table " <> tableName <> " is missing." main :: IO () main = do -- cgit v1.2.3