pub struct ScaledStyleMetrics<'a, S: Scale> {
metrics: &'a StyleMetrics,
scale: S,
}Expand description
Style measurements in a caller’s own units.
Scaling is done when a measurement is requested. The italic angle and fixed-pitch flag have no length to scale and are returned unchanged.
Fields§
§metrics: &'a StyleMetrics§scale: SImplementations§
Source§impl<'a, S: Scale> ScaledStyleMetrics<'a, S>
impl<'a, S: Scale> ScaledStyleMetrics<'a, S>
pub(crate) fn new(metrics: &'a StyleMetrics, scale: S) -> Self
Sourcepub fn subscript(&self) -> Option<ScriptMetrics<S::Value>>
pub fn subscript(&self) -> Option<ScriptMetrics<S::Value>>
Returns the suggested subscript em box and placement.
Sourcepub fn superscript(&self) -> Option<ScriptMetrics<S::Value>>
pub fn superscript(&self) -> Option<ScriptMetrics<S::Value>>
Returns the suggested superscript em box and placement.
Sourcepub fn underline(&self) -> Option<Decoration<S::Value>>
pub fn underline(&self) -> Option<Decoration<S::Value>>
Returns the suggested underline position and thickness.
Sourcepub fn strike_through(&self) -> Option<Decoration<S::Value>>
pub fn strike_through(&self) -> Option<Decoration<S::Value>>
Returns the suggested strikethrough position and thickness.
Sourcepub fn italic_angle(&self) -> Option<Fixed>
pub fn italic_angle(&self) -> Option<Fixed>
Returns the italic angle in degrees, unaffected by scaling.
Sourcepub fn is_fixed_pitch(&self) -> Option<bool>
pub fn is_fixed_pitch(&self) -> Option<bool>
Returns whether the font reports a fixed pitch.
fn scale_script(&self, script: ScriptMetrics) -> ScriptMetrics<S::Value>
fn scale_decoration(&self, decoration: Decoration) -> Decoration<S::Value>
Trait Implementations§
Source§impl<'a, S: Clone + Scale> Clone for ScaledStyleMetrics<'a, S>
impl<'a, S: Clone + Scale> Clone for ScaledStyleMetrics<'a, S>
Source§fn clone(&self) -> ScaledStyleMetrics<'a, S>
fn clone(&self) -> ScaledStyleMetrics<'a, S>
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<'a, S: Copy + Scale> Copy for ScaledStyleMetrics<'a, S>
Auto Trait Implementations§
impl<'a, S> Freeze for ScaledStyleMetrics<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for ScaledStyleMetrics<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for ScaledStyleMetrics<'a, S>where
S: Send,
impl<'a, S> Sync for ScaledStyleMetrics<'a, S>where
S: Sync,
impl<'a, S> Unpin for ScaledStyleMetrics<'a, S>where
S: Unpin,
impl<'a, S> UnsafeUnpin for ScaledStyleMetrics<'a, S>where
S: UnsafeUnpin,
impl<'a, S> UnwindSafe for ScaledStyleMetrics<'a, S>where
S: UnwindSafe,
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