pub struct Word {
pub text: String,
pub rect: Rect,
pub range: Range<CharIndex>,
pub font: Option<String>,
pub size: f64,
}Expand description
One word of a page’s text, from TextPage::words.
Fields§
§text: StringThe word, without surrounding whitespace.
rect: RectThe union of its characters’ boxes, in page space — the same
coordinates TextPage::rects reports. A word none of whose glyphs
has a visible box reports Rect::ZERO.
range: Range<CharIndex>The characters this word was cut from, so TextPage::slice on it
gives back text and the characters around it give
context.
font: Option<String>The base font name of the first character’s font, when the font has
one — see TextPage::font_name.
size: f64The first character’s font size in page points: the Tf operand
scaled by the text matrix, so 1 Tf under a 12 0 0 12 matrix reads
as 12.
Trait Implementations§
impl StructuralPartialEq for Word
Auto Trait Implementations§
impl Freeze for Word
impl RefUnwindSafe for Word
impl Send for Word
impl Sync for Word
impl Unpin for Word
impl UnsafeUnpin for Word
impl UnwindSafe for Word
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
Mutably borrows from an owned value. Read more