summaryrefslogtreecommitdiff
path: root/src/Graphics/Fountainhead/Parser.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-11-18 04:40:17 +0100
committerEugen Wissner <belka@caraus.de>2023-11-18 04:40:17 +0100
commit9a11ff5dd465cef33317ef6cc858f861956ade55 (patch)
tree4fdf0019b60c71057fb872a852b04c0707d171f0 /src/Graphics/Fountainhead/Parser.hs
parent344467b8508b86838ba652f719a017f3415c9a96 (diff)
downloadfountainhead-9a11ff5dd465cef33317ef6cc858f861956ade55.tar.gz
Dump hmtx
Diffstat (limited to 'src/Graphics/Fountainhead/Parser.hs')
-rw-r--r--src/Graphics/Fountainhead/Parser.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Graphics/Fountainhead/Parser.hs b/src/Graphics/Fountainhead/Parser.hs
index f39cbda..96209f7 100644
--- a/src/Graphics/Fountainhead/Parser.hs
+++ b/src/Graphics/Fountainhead/Parser.hs
@@ -337,9 +337,9 @@ longHorMetricP = LongHorMetric
<$> Megaparsec.Binary.word16be
<*> Megaparsec.Binary.int16be
-hmtxTableP :: Int -> Parser HmtxTable
+hmtxTableP :: Word16 -> Parser HmtxTable
hmtxTableP numOfLongHorMetrics = HmtxTable
- <$> countP numOfLongHorMetrics longHorMetricP
+ <$> countP (fromIntegral numOfLongHorMetrics) longHorMetricP
<*> Megaparsec.many Megaparsec.Binary.int16be
-- * Glyph name and PostScript font table
@@ -928,7 +928,7 @@ parseTable
-> Parser a
-> Megaparsec.State ByteString Void
-> Either (Megaparsec.ParseErrorBundle ByteString Void) a
-parseTable TableDirectory{ offset, length } parser state = snd
+parseTable TableDirectory{ offset, length = length' } parser state = snd
$ Megaparsec.runParser' parser
$ state
{ Megaparsec.stateInput = stateInput
@@ -940,7 +940,7 @@ parseTable TableDirectory{ offset, length } parser state = snd
}
where
posState = Megaparsec.statePosState state
- stateInput = ByteString.take length
+ stateInput = ByteString.take length'
$ ByteString.drop (offset - Megaparsec.stateOffset state)
$ Megaparsec.stateInput state
stateOffset = offset