From 41b5c14e2f5d7140d7d5a1bd7201e70a8a137dcd Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 11 Feb 2024 18:50:25 +0100 Subject: Add Fixed32 numeric instances --- test/Graphics/Fountainhead/MetricsSpec.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/Graphics/Fountainhead/MetricsSpec.hs b/test/Graphics/Fountainhead/MetricsSpec.hs index d122579..63f03cd 100644 --- a/test/Graphics/Fountainhead/MetricsSpec.hs +++ b/test/Graphics/Fountainhead/MetricsSpec.hs @@ -10,23 +10,23 @@ module Graphics.Fountainhead.MetricsSpec import Graphics.Fountainhead.Metrics import Test.Hspec (Spec, describe, it, shouldBe) +import qualified Data.ByteString as ByteString spec :: Spec spec = describe "collectMetrics" $ it "collects information from the name table" $ do - let expected = FontDescriptor - { fontName = "fontName" - , flags = [] - , fullName = "fullName" - , familyName = "familyName" - , weight = "weight" - , fontBBox = FontBBox 0 0 0 0 - , version = "1.0.0" - , notice = "Notice" - , encodingScheme = "encodingScheme" - , isFixedPitch = False - , ascender = 0 - , descender = 0 + let fontPath = "./fonts/OpenSans-Bold.ttf" + expected = FontDescriptor + { fontName = "OpenSansāˆ’Bold" + , flags = [] -- 4 + , ascender = 1068 + , descender = -292 + , fontBBox = FontBBox (-548) (-271) 1201 1047 + , italicAngle = 0 + , capHeight = 714 + , stemV = 105 + , missingWidth = 600 } - in collectMetrics `shouldBe` expected + openSansBoldItalic <- ByteString.readFile fontPath + collectMetrics fontPath openSansBoldItalic `shouldBe` Right expected -- cgit v1.2.3