Safe Haskell | None |
---|---|
Language | Haskell2010 |
Infrastructure for parsing & desugaring length units & keywords, in reference to the selected font.
Synopsis
- type Unitted = (Double, Text)
- auto :: Unitted
- parseLength :: [Token] -> Maybe Unitted
- parseLength' :: [Token] -> Maybe (Double, Text)
- n2f :: (Fractional x, RealFloat x) => NumericValue -> x
- finalizeLength :: Unitted -> Font' -> Length
- px2pt :: Font' -> Double -> Double
- data Font' = Font' {
- hbFont :: Font
- pattern :: Pattern
- fontHeight :: Char -> Double
- fontAdvance :: Char -> Double
- fontSize :: Double
- rootEm :: Double
- lineheight :: Double
- rlh :: Double
- vh :: Double
- vw :: Double
- vmax :: Double
- vmin :: Double
- scale :: Double
Documentation
type Unitted = (Double, Text) Source #
A number+unit, prior to resolving side units. The unit may alternately represent a keyword, in which case the number is ignored & typically set to 0.
parseLength :: [Token] -> Maybe Unitted Source #
Parse a pre-tokenized CSS length value.
parseLength' :: [Token] -> Maybe (Double, Text) Source #
Variant of parseLength
which supports min-content & max-content keywords.
finalizeLength :: Unitted -> Font' -> Length Source #
Resolve a parsed length according to the sizing parameters in a given Font
`.
A Harfbuzz font with sizing parameters.
Font' | |
|