pub struct TextBounds {
pub layout: CanvasRect,
pub content: CanvasRect,
pub ink: Option<CanvasRect>,
pub line_count: u32,
pub baselines: Baselines,
}Expand description
Where a text lies, as fractions of the canvas from (0, 0) top-left to (1, 1)
bottom-right. For a text generator this is on its picture, before the clip’s transform
and effects; for a caption it is on the canvas.
Fields§
§layout: CanvasRectThe box the style’s anchor and position place: the wrapping width wide, every line’s em box tall, plus whole pixels of outline and background padding.
content: CanvasRectThe span of the lines’ advances, as tall as the layout and with the same decorations. It moves only with the advances, not with glyph ink.
ink: Option<CanvasRect>What the text draws (glyphs, outline, background boxes), as
alpha2_text::TextMeasure::ink bounds it, within the texture’s sampling spread.
None when the text draws nothing.
line_count: u32Number of laid-out lines.
baselines: BaselinesThe first and last lines’ alphabetic baselines.
Trait Implementations§
Source§impl Clone for TextBounds
impl Clone for TextBounds
Source§fn clone(&self) -> TextBounds
fn clone(&self) -> TextBounds
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextBounds
Source§impl Debug for TextBounds
impl Debug for TextBounds
Source§impl PartialEq for TextBounds
impl PartialEq for TextBounds
impl StructuralPartialEq for TextBounds
Auto Trait Implementations§
impl Freeze for TextBounds
impl RefUnwindSafe for TextBounds
impl Send for TextBounds
impl Sync for TextBounds
impl Unpin for TextBounds
impl UnsafeUnpin for TextBounds
impl UnwindSafe for TextBounds
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more