cattrap-0.2.0.0: Lays out boxes according to the CSS Box Model.
Safe HaskellNone
LanguageHaskell2010

Graphics.Layout.CSS.Font

Description

Infrastructure for parsing & desugaring CSS properties related to fonts.

Synopsis

Documentation

data Font' Source #

A Harfbuzz font with sizing parameters.

Constructors

Font' 

Fields

  • hbFont :: Font

    The Harfbuzz font used to shape text & query character-size information.

  • pattern :: Pattern

    The FontConfig query result. Useful to incorporate into output rendering.

  • fontHeight :: Char -> Double

    Query the height of a character. Used for cap, ex, or ic units.

  • fontAdvance :: Char -> Double

    Query the width of a character, used for ch unit.

  • fontSize :: Double

    The desired font-size, used for em unit.

  • rootEm :: Double

    The root font's size, used for rem unit.

  • lineheight :: Double

    The desired line-height, used for lh unit.

  • rlh :: Double

    The root font's line-height, used for rlh unit.

  • vh :: Double

    Scale-factor for vh unit.

  • vw :: Double

    Scale-factor for vw unit.

  • vmax :: Double

    Scale-factor for vmax unit.

  • vmin :: Double

    Scale-factor for vmin unit.

  • scale :: Double

    How many device pixels in a CSS px?

Instances

Instances details
Eq Font' Source # 
Instance details

Defined in Graphics.Layout.CSS.Length

Methods

(==) :: Font' -> Font' -> Bool

(/=) :: Font' -> Font' -> Bool

(PropertyParser x, Zero m, Zero n) => Default (UserData m n x) Source # 
Instance details

Defined in Graphics.Layout.CSS

Methods

def :: UserData m n x Source #

placeholderFont :: Font' Source #

zero'd Font` to serve as the root's parent in a font heirarchy.

hbUnit :: Double Source #

Scale-factor for text-shaping APIs.

pattern2hbfont :: Pattern -> Int -> [Variation] -> Font Source #

Convert from FontConfig query result to a Harfbuzz font.

pattern2font :: Pattern -> CSSFont -> Font' -> Font' -> Font' Source #

Convert Parsed CSS to a Font`. Includes sizing parameters derived from a root & parent Font`.

data CSSFont Source #

Parsed CSS font properties, excluding the FontConfig query.

Constructors

CSSFont 

Fields

Instances

Instances details
PropertyParser CSSFont Source # 
Instance details

Defined in Graphics.Layout.CSS.Font

Methods

temp :: CSSFont

inherit :: CSSFont -> CSSFont

priority :: CSSFont -> [Text]

shorthand :: CSSFont -> Text -> [Token] -> [(Text, [Token])]

longhand :: CSSFont -> CSSFont -> Text -> [Token] -> Maybe CSSFont

getVars :: CSSFont -> Props

setVars :: Props -> CSSFont -> CSSFont

pseudoEl :: CSSFont -> Text -> (CSSFont -> Maybe CSSFont -> CSSFont) -> CSSFont

variations' :: Double -> CSSFont -> [Variation] Source #

All font-variations from the parsed CSS properties. | Requires the resolved font-size in case font-optical-sizing is set.