pub struct TextRun {
pub x_pt: f32,
pub baseline_from_top_pt: f32,
pub size_pt: f32,
pub font: Font,
pub text: String,
pub actual_text: Option<String>,
pub glyphs: Vec<ShapedGlyph>,
}Expand description
A single horizontal run of text on a page. The MVP 0 emitter produces one run per word; coalescing same-font neighbours is an MVP 2 optimisation.
Fields§
§x_pt: f32X coordinate of the run’s left edge, measured from the page’s left edge in points.
baseline_from_top_pt: f32Y coordinate of the run’s baseline, measured from the page’s top edge in points. The PDF backend flips to bottom-origin once when emitting.
size_pt: f32Font size in points.
font: FontFont face for this run.
text: StringOriginal UTF-8 text. Used by the PDF backend’s /ToUnicode
CMap (so copy-paste from the rendered PDF round-trips back to
the source) and by the Base14 emit path (which encodes through
WinAnsiEncoding + per-document /Differences).
actual_text: Option<String>Optional semantic replacement text for PDF /ActualText.
Raw blocks use this when the painted text must differ from
source text, e.g. tabs painted as spaces but copied as tabs.
glyphs: Vec<ShapedGlyph>Shaped glyph stream for embedded-font runs. Empty for Base14
runs, which emit through the byte-encoded WinAnsi path
instead.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextRun
impl RefUnwindSafe for TextRun
impl Send for TextRun
impl Sync for TextRun
impl Unpin for TextRun
impl UnsafeUnpin for TextRun
impl UnwindSafe for TextRun
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.