Add an option for dumping a single table

This commit is contained in:
2024-02-06 12:14:07 +01:00
parent 3160ceab08
commit 23271d6f6c
6 changed files with 164 additions and 87 deletions

View File

@@ -13,6 +13,7 @@
module Graphics.Fountainhead.Parser
( Parser
, ParseErrorBundle
, ParseState
, cmapTableP
, cvTableP
, f2Dot14P
@@ -154,6 +155,7 @@ import qualified Text.Megaparsec.Byte.Binary as Megaparsec.Binary
type Parser = Megaparsec.Parsec Void ByteString
type ParseErrorBundle = Megaparsec.ParseErrorBundle ByteString Void
type ParseState = Megaparsec.State ByteString Void
-- * Font directory
@@ -953,7 +955,7 @@ fixedP = Fixed32 . fromIntegral <$> Megaparsec.Binary.word32be
parseTable
:: TableDirectory
-> Parser a
-> Megaparsec.State ByteString Void
-> ParseState
-> Either ParseErrorBundle a
parseTable TableDirectory{ offset, length = length' } parser state = snd
$ Megaparsec.runParser' parser