cattrap-0.1.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?

placeholderFont :: Font' Source #

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

hbScale :: Font' -> Double Source #

Scale-factor for text-shaping APIs.

hbUnit :: Double Source #

Magic number informing the value of hbScale.

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

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.