diff options
Diffstat (limited to 'test/Graphics/Fountainhead/MetricsSpec.hs')
| -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 |
