pub struct TextFragment {Show 13 fields
pub text: String,
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
pub font_size: f64,
pub font_name: Option<String>,
pub is_bold: bool,
pub is_italic: bool,
pub color: Option<Color>,
pub space_decisions: Vec<SpaceDecision>,
pub mcid: Option<u32>,
pub struct_tag: Option<String>,
}Expand description
A fragment of text with position information
Fields§
§text: StringText content
x: f64X position in page coordinates
y: f64Y position in page coordinates
width: f64Width of the text
height: f64Height of the text
font_size: f64Font size
font_name: Option<String>Font name (if known) - used for kerning-aware text spacing
is_bold: boolWhether the font is bold (detected from font name)
is_italic: boolWhether the font is italic (detected from font name)
color: Option<Color>Fill color of the text (from graphics state)
space_decisions: Vec<SpaceDecision>Space insertion decisions (empty unless track_space_decisions is true).
mcid: Option<u32>Marked-content identifier from the innermost ancestor BDC with /MCID
(issue #269 Phase 1). None for non-tagged PDFs, which preserves the
pre-Phase-1 grouping behavior (None == None collapses to legacy keys).
struct_tag: Option<String>Structural tag of the owning BDC (e.g. "P", "H1", "Figure",
"Artifact"). Set on the same ancestor that supplied mcid. Phase 3
will consume this for partitioner classification; Phase 1 only carries it.
Trait Implementations§
Source§impl Clone for TextFragment
impl Clone for TextFragment
Source§fn clone(&self) -> TextFragment
fn clone(&self) -> TextFragment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more