pub struct TextBounds {
pub layout: CanvasRect,
pub content: CanvasRect,
pub ink: Option<CanvasRect>,
pub line_count: u32,
}Expand description
Where a text lies, as fractions of the canvas, (0, 0) top-left to
(1, 1) bottom-right, as its style’s position is: on the picture a text
generator draws, before its clip’s transform and effects, and on the
canvas for a caption. measure_text measures it.
Fields§
§layout: CanvasRectThe box the style’s anchor and position place: the wrapping width wide, every line’s em box tall, and the whole pixels of outline and background padding around that.
content: CanvasRectThe lines’ advances: from the start of the line that starts farthest left to the end of the one that ends farthest right, as tall as the layout, with the same decorations around it. It moves only as the advances do, not as glyphs with more or less ink are typed.
ink: Option<CanvasRect>What the text draws: its glyphs, their outline, and the background’s
boxes, as alpha2_text::TextMeasure::ink bounds them at the measured
size. Every pixel the text gives any alpha there meets it, give or
take the pixel sampling the texture spreads it by. None when the text
draws nothing.
line_count: u32Number of laid-out lines.
Trait Implementations§
Source§impl Clone for TextBounds
impl Clone for TextBounds
impl 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
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> ⓘ
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> ⓘ
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