pub struct AppContextTextMeasurer;Expand description
Measures draw-scope text against the app’s fonts.
Every call lands in [super::measure::measure_resolved_text], backed by the
app context’s metrics cache — so measuring an unchanged string every frame
is a hash lookup, not a shaping pass.
“Resolved” is the whole point: a DrawTextStyle states final sizes, and a
scene lowers a text primitive with style.resolved_font_size() untouched,
so the system font scale must not be folded in here. It is applied where an
unresolved size lives instead — the Text composable’s Sp values — and
that path carries the scaled style through to the renderer with it.
Implementations§
Source§impl AppContextTextMeasurer
impl AppContextTextMeasurer
A shared measurer to hand to
DrawScopeDefault::with_text_measurer.
Trait Implementations§
Source§impl Clone for AppContextTextMeasurer
impl Clone for AppContextTextMeasurer
Source§fn clone(&self) -> AppContextTextMeasurer
fn clone(&self) -> AppContextTextMeasurer
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 AppContextTextMeasurer
Source§impl Debug for AppContextTextMeasurer
impl Debug for AppContextTextMeasurer
Source§impl Default for AppContextTextMeasurer
impl Default for AppContextTextMeasurer
Source§fn default() -> AppContextTextMeasurer
fn default() -> AppContextTextMeasurer
Returns the “default value” for a type. Read more
Source§impl DrawTextMeasurer for AppContextTextMeasurer
impl DrawTextMeasurer for AppContextTextMeasurer
fn measure_text(&self, text: &str, style: &DrawTextStyle) -> TextMeasurement
Auto Trait Implementations§
impl Freeze for AppContextTextMeasurer
impl RefUnwindSafe for AppContextTextMeasurer
impl Send for AppContextTextMeasurer
impl Sync for AppContextTextMeasurer
impl Unpin for AppContextTextMeasurer
impl UnsafeUnpin for AppContextTextMeasurer
impl UnwindSafe for AppContextTextMeasurer
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