diff options
| author | Eugen Wissner <belka@caraus.de> | 2024-02-11 18:50:25 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2024-02-11 18:50:25 +0100 |
| commit | 41b5c14e2f5d7140d7d5a1bd7201e70a8a137dcd (patch) | |
| tree | bf43eea1e72b09f5f227763c0dc8d3bb0435a183 /test/Graphics | |
| parent | c5f715ac7cdfb663fc84cb9fe841903b5aed99c5 (diff) | |
| download | fountainhead-41b5c14e2f5d7140d7d5a1bd7201e70a8a137dcd.tar.gz | |
Add Fixed32 numeric instances
Diffstat (limited to 'test/Graphics')
| -rw-r--r-- | test/Graphics/Fountainhead/MetricsSpec.hs | 28 |
1 files changed, 14 insertions, 14 deletions
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 |
