From 23271d6f6cf033230106f07ae14985f3b85f906a Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 6 Feb 2024 12:14:07 +0100 Subject: Add an option for dumping a single table --- lib/Graphics/Fountainhead/Parser.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Graphics/Fountainhead/Parser.hs') diff --git a/lib/Graphics/Fountainhead/Parser.hs b/lib/Graphics/Fountainhead/Parser.hs index 31dcd0e..672f9fc 100644 --- a/lib/Graphics/Fountainhead/Parser.hs +++ b/lib/Graphics/Fountainhead/Parser.hs @@ -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 -- cgit v1.2.3