pub struct CharEvent {
pub char_code: u32,
pub unicode: Option<String>,
pub font_name: String,
pub font_size: f64,
pub text_matrix: [f64; 6],
pub ctm: [f64; 6],
pub displacement: f64,
pub char_spacing: f64,
pub word_spacing: f64,
pub h_scaling: f64,
pub rise: f64,
}Expand description
Information about a rendered character glyph.
Produced by the interpreter when processing text rendering operators (Tj, TJ, ’, “). Contains all positioning and font context needed to compute the final character bounding box.
Fields§
§char_code: u32The character code from the PDF content stream.
unicode: Option<String>Unicode text if a ToUnicode mapping is available.
font_name: StringFont name (e.g., “Helvetica”, “BCDFEE+ArialMT”).
font_size: f64Font size in text space units.
text_matrix: [f64; 6]The text rendering matrix at the time of rendering (6-element affine).
ctm: [f64; 6]The current transformation matrix at the time of rendering.
displacement: f64Glyph displacement (advance width) in glyph space units (1/1000 of text space).
char_spacing: f64Character spacing value (Tc operator).
word_spacing: f64Word spacing value (Tw operator), applied for space characters.
h_scaling: f64Horizontal scaling factor (Tz operator, as a fraction: 100% = 1.0).
rise: f64Text rise value (Ts operator) for superscript/subscript.