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

View File

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

View File

@ -133,7 +133,8 @@ collectMetrics fontFile ttfContents =
(_processedState, Left initialResult) -> Left
$ MetricsParseError initialResult
(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
psNameIndex <- maybeMetricsError (MetricsNameRecordNotFound 6)