Dump hmtx
This commit is contained in:
10
app/Main.hs
10
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
|
||||
|
Reference in New Issue
Block a user