pub struct TextState {
pub font: Option<(Arc<Font>, f32)>,
pub font_source: Option<ObjRef>,
pub char_space: f32,
pub word_space: f32,
pub horz_scale: f32,
pub leading: f32,
pub rise: f32,
pub render_mode: TextRenderMode,
pub stroke_ctm: [f32; 4],
}Expand description
The text-showing parameters (ISO 32000-1 table 105).
Equality compares the font by its identity rather than its contents: a
Font is a large loaded object with no meaningful structural equality,
and two states holding the same Arc are the same state.
Fields§
§font: Option<(Arc<Font>, f32)>The font and its size. Tf always sets the size, and sets the font
only when the name resolved — so a bad /Font name changes the size
and leaves the font standing.
font_source: Option<ObjRef>The /Font resource entry the current font came from, so a
regenerated content stream can name the same object. None when the
resource was written inline, and therefore has no object to name.
char_space: f32Tc, added after each glyph.
word_space: f32Tw, added after each single-byte space.
horz_scale: f32Tz as a fraction: 150 Tz is 1.5.
leading: f32TL, the distance between baselines.
rise: f32Ts, the baseline offset.
render_mode: TextRenderModeTr.
stroke_ctm: [f32; 4]The 2×2 linear part of the CTM at the Tj, stored as [a, c, b, d].
Set only when Self::render_mode strokes (modes 1, 2, 5, 6); a fill
keeps the identity [1, 0, 0, 1]. The transposition is the oracle’s
four-float slot (text_ctm[1] = ctm.c, text_ctm[2] = ctm.b): a
stroke’s width is measured in user space (ISO 32000-1 §8.4.3.2), so a
scaling CTM has to be folded into the device matrix rather than left
on the text matrix, and this is the matrix that split consumes.