Add Fixed32 numeric instances
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user