Native inline CSS font shorthand
HPDFDecodeHeadlessRichText accepts bounded inline font shorthand and expands its font size, weight, italic and supplied-family components before the existing per-property cascade is applied
<span style="font-weight:bold!important;font:italic 10pt Sans">Text</span>
This example produces bold italic text at 10 points: the earlier important weight stays bold whilst the shorthand sets its other components; omitted weight and italic reset to regular when no higher-priority component prevents that reset
Valid font:inherit restores the enclosing font properties; em and percentage sizing uses the enclosing computed size, and later important declarations win only for their affected components
Size units are pt, px at 96 dpi, em, percent, pc, cm, mm and in; qualifiers are normal, italic, oblique, bold, bolder, lighter and integer hundreds from 100 up to 900
A required family list follows the size; when FontFamilyNames is configured, the existing named-family selection and PreserveFontFamilyLists behaviour preserve authored preference before supplied-font resolution
Without configured names, the supported font size and style components still apply whilst family selection retains the existing single-family profile; this parser does not load fonts
An optional slash accepts normal, nonnegative numeric factors and supported line-height lengths or percentages; actual paragraph line boxes apply independent height priority together with inherited computed values
The complete shorthand must be valid before any component or priority changes; unsupported shorthand keeps previous styles and ordinary text; small caps, stretch, system fonts, external style sheets and general CSS layout remain outside the bounded profile
Colour, underline, strikeout and paragraph alignment remain independent; the existing decoder bounds and cancellation error type are preserved
Six actual native targets verify decoded properties and saved PDFs against the exact supplied font programs, CID-to-GID mappings, ToUnicode, appearance geometry and independently rendered visible pixels
Native decoder · Decode options · Ordered supplied-family candidates
Numeric math expressions are accepted for size and slash height, including balanced functions containing spaces or division and the new root-relative and explicit viewport length units