pub struct PxScaleFont<F> {
pub font: F,
pub scale: PxScale,
}
Expand description
A Font
and an associated pixel scale.
Fields
font: F
scale: PxScale
Implementations
impl<F> PxScaleFont<F>
impl<F> PxScaleFont<F>
pub fn with_scale<S>(self, scale: S) -> PxScaleFont<F> where
S: Into<PxScale>,
Trait Implementations
impl<F> Clone for PxScaleFont<F> where
F: Clone,
impl<F> Clone for PxScaleFont<F> where
F: Clone,
fn clone(&self) -> PxScaleFont<F>
fn clone(&self) -> PxScaleFont<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<F> Debug for PxScaleFont<F> where
F: Debug,
impl<F> Debug for PxScaleFont<F> where
F: Debug,
impl<F> ScaleFont<F> for PxScaleFont<F> where
F: Font,
impl<F> ScaleFont<F> for PxScaleFont<F> where
F: Font,
fn codepoint_ids(&self) -> CodepointIdIter<'_>ⓘNotable traits for CodepointIdIter<'a>impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
fn codepoint_ids(&self) -> CodepointIdIter<'_>ⓘNotable traits for CodepointIdIter<'a>impl<'a> Iterator for CodepointIdIter<'a> type Item = (GlyphId, char);
Returns an iterator of all distinct (GlyphId, char)
pairs. Not ordered. Read more
fn h_scale_factor(&self) -> f32
fn h_scale_factor(&self) -> f32
Scale factor for unscaled font horizontal values.
fn v_scale_factor(&self) -> f32
fn v_scale_factor(&self) -> f32
Scale factor for unscaled font vertical values.
fn scale_factor(&self) -> PxScaleFactor
fn scaled_glyph(&self, c: char) -> Glyph
fn scaled_glyph(&self, c: char) -> Glyph
fn h_side_bearing(&self, id: GlyphId) -> f32
fn h_side_bearing(&self, id: GlyphId) -> f32
Pixel scaled horizontal side bearing for a given glyph.
fn v_side_bearing(&self, id: GlyphId) -> f32
fn v_side_bearing(&self, id: GlyphId) -> f32
Pixel scaled vertical side bearing for a given glyph.
fn kern(&self, first: GlyphId, second: GlyphId) -> f32
fn kern(&self, first: GlyphId, second: GlyphId) -> f32
Returns additional pixel scaled kerning to apply for a particular pair of glyphs.
fn glyph_bounds(&self, glyph: &Glyph) -> Rect
fn glyph_bounds(&self, glyph: &Glyph) -> Rect
Returns the layout bounds of this glyph. These are different to the outline px_bounds()
. Read more
fn glyph_count(&self) -> usize
fn glyph_count(&self) -> usize
The number of glyphs present in this font. Glyph identifiers for this
font will always be in the range 0..self.glyph_count()
Read more
fn outline_glyph(&self, glyph: Glyph) -> Option<OutlinedGlyph>
fn outline_glyph(&self, glyph: Glyph) -> Option<OutlinedGlyph>
Compute glyph outline ready for drawing. Read more
impl<F> Copy for PxScaleFont<F> where
F: Copy,
Auto Trait Implementations
impl<F> RefUnwindSafe for PxScaleFont<F> where
F: RefUnwindSafe,
impl<F> Send for PxScaleFont<F> where
F: Send,
impl<F> Sync for PxScaleFont<F> where
F: Sync,
impl<F> Unpin for PxScaleFont<F> where
F: Unpin,
impl<F> UnwindSafe for PxScaleFont<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.