Every preparation API takes a font string. The parser accepts a CSS-like subset and maps it into the SkiaSharp font state used for measurement.
The parser looks for:
pxitalic or obliqueExamples:
"16px Inter"
"700 18px \"IBM Plex Sans\""
"italic 16px Georgia"
"600 15px system-ui"
"16px Menlo, monospace"
| Token | Effect |
|---|---|
bold |
weight 700 |
numeric weight such as 500 or 700 |
mapped to normal, medium, or bold Skia font weight |
italic or oblique |
italic slant |
If the primary family is a generic CSS family, Pretext maps it to a concrete desktop fallback:
| Input family | Effective family |
|---|---|
sans-serif, system-ui |
Arial |
serif |
Times New Roman |
monospace, ui-monospace |
Menlo |
If the parser cannot find a valid size, it falls back to 16px Arial.
%, em, rem, and other non-pixel unitsIf a /line-height segment appears after the size, it is ignored by the parser. You still pass line height explicitly to layout methods.
Pretext measures through SkiaSharp and stores:
Because line height is caller-supplied, you stay in control of:
font size * constant.