diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-11-18 04:40:17 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-11-18 04:40:17 +0100 |
| commit | 9a11ff5dd465cef33317ef6cc858f861956ade55 (patch) | |
| tree | 4fdf0019b60c71057fb872a852b04c0707d171f0 /app | |
| parent | 344467b8508b86838ba652f719a017f3415c9a96 (diff) | |
| download | fountainhead-9a11ff5dd465cef33317ef6cc858f861956ade55.tar.gz | |
Dump hmtx
Diffstat (limited to 'app')
| -rw-r--r-- | app/Main.hs | 10 |
1 files changed, 7 insertions, 3 deletions
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 |
