Safe Haskell | Safe-Inferred |
---|---|
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)
- units :: [Text]
- n2f :: (Fractional x, RealFloat x) => NumericValue -> x
- finalizeLength :: Unitted -> Font' -> Length
- finalizeLengths :: Font' -> [Token] -> [Token]
- px2pt :: Font' -> Double -> Double
- data Font' = Font' {}
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 (Double, Text) Source #
Variant of parseLength
which supports min-content & max-content keywords.
n2f :: (Fractional x, RealFloat x) => NumericValue -> x Source #
Convert a lexed number to a Double.
finalizeLength :: Unitted -> Font' -> Length Source #
Resolve a parsed length according to the sizing parameters in a given Font'
.
finalizeLengths :: Font' -> [Token] -> [Token] Source #
Convert any length-units in the given CSS tokens to device pixels
A Harfbuzz font with sizing parameters.
Font' | |
|