Skip to content

API reference / Common / Engine types / TextStyle

Interface: TextStyle ​

PDF text-state operators grouped into one struct — Tf, Tc, Tw, Tz, TL, Tr, Ts, Tk.

One TextStyle lives on each TextRegularRun, grouping every text-state operator's contribution into a single struct rather than spreading them across many TextRegularRun fields. Stroke / fill paint colors, soft mask, and call-uniform compositing live on the matching *Style fields of TextRegularRun, not here.

Properties ​

PropertyDescription
font
string
PDF Tf — font. Always resolvable: every udoc graphics-object resource reference points at a registry entry. Importers are responsible for guaranteeing this — for PDF, every paint- producing text run comes from either a page content stream (where /Tj requires /Tf first) or a Do invocation that inherits the caller's font, so the font is always known by the time a run reaches the udoc model.
fontSize
number
PDF Tf — font size, in text-space units.
charSpacing
number
PDF Tc — additional horizontal advance per glyph.
wordSpacing
number
PDF Tw — additional horizontal advance per word space.
horizontalScaling
number
PDF Tz — horizontal scaling (percent, 100.0 is unscaled).
leading
number
PDF TL — line leading.
rise
number
PDF Ts — text rise (vertical offset from baseline).
renderMode
TextRenderingMode
PDF Tr — text rendering mode (which of fill / stroke / both the run paints).
knockout
boolean
PDF Tk — text knockout (whether glyphs in a single BT…ET block knock each other out where they overlap).