Make compatible with GHC2025

This commit is contained in:
Eugen Wissner 2025-01-14 20:00:11 +01:00
parent 0999156508
commit 9cafd8d97d
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
3 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,7 @@ author: Eugen Wissner
license-files: LICENSE license-files: LICENSE
license: MPL-2.0 license: MPL-2.0
copyright: (c) 2024 Eugen Wissner copyright: (c) 2025 Eugen Wissner
category: Graphics category: Graphics
extra-source-files: extra-source-files:
@ -25,7 +25,7 @@ common dependencies
bytestring ^>= 0.12.0, bytestring ^>= 0.12.0,
text ^>= 2.1, text ^>= 2.1,
zlib ^>= 0.7.0 zlib ^>= 0.7.0
default-language: GHC2021 default-language: GHC2024
library library
import: dependencies import: dependencies
@ -39,9 +39,9 @@ library
Graphics.Fountainhead.TrueType Graphics.Fountainhead.TrueType
hs-source-dirs: lib hs-source-dirs: lib
build-depends: build-depends:
containers ^>= 0.6.5, containers ^>= 0.7,
megaparsec ^>= 9.7, megaparsec ^>= 9.7,
time ^>= 1.12, time ^>= 1.14,
transformers ^>= 0.6, transformers ^>= 0.6,
vector ^>= 0.13.0 vector ^>= 0.13.0
ghc-options: -Wall ghc-options: -Wall

View File

@ -96,6 +96,7 @@ import qualified Text.Megaparsec as Megaparsec
import Graphics.Fountainhead.Parser import Graphics.Fountainhead.Parser
( ParseErrorBundle ( ParseErrorBundle
, ParseState , ParseState
, Parser
, parseTable , parseTable
, cmapTableP , cmapTableP
, headTableP , headTableP
@ -831,6 +832,7 @@ parseRequired processedState fontDirectory = do
, locaTable = requiredLoca , locaTable = requiredLoca
} }
where where
findRequired :: String -> Parser a -> Either DumpError a
findRequired tableName parser = findRequired tableName parser =
let missingError = Left $ DumpRequiredTableMissingError tableName let missingError = Left $ DumpRequiredTableMissingError tableName
parseFound tableEntry = parseTable tableEntry parser processedState parseFound tableEntry = parseTable tableEntry parser processedState

View File

@ -133,7 +133,8 @@ collectMetrics fontFile ttfContents =
(_processedState, Left initialResult) -> Left (_processedState, Left initialResult) -> Left
$ MetricsParseError initialResult $ MetricsParseError initialResult
(processedState, Right initialResult) -> do (processedState, Right initialResult) -> do
let parseForMetrics' = parseForMetrics processedState initialResult let parseForMetrics' :: String -> Parser a -> Either MetricsError a
parseForMetrics' = parseForMetrics processedState initialResult
NameTable{ nameRecord, variable } <- parseForMetrics' "name" nameTableP NameTable{ nameRecord, variable } <- parseForMetrics' "name" nameTableP
psNameIndex <- maybeMetricsError (MetricsNameRecordNotFound 6) psNameIndex <- maybeMetricsError (MetricsNameRecordNotFound 6)