Struct ab_glyph::PxScaleFont
source · 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§
source§impl<F> PxScaleFont<F>
impl<F> PxScaleFont<F>
pub fn with_scale<S: Into<PxScale>>(self, scale: S) -> Self
Trait Implementations§
source§impl<F: Clone> Clone for PxScaleFont<F>
impl<F: Clone> Clone for PxScaleFont<F>
source§fn clone(&self) -> PxScaleFont<F>
fn clone(&self) -> PxScaleFont<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<F: Debug> Debug for PxScaleFont<F>
impl<F: Debug> Debug for PxScaleFont<F>
source§impl<F: Font> ScaleFont<F> for PxScaleFont<F>
impl<F: Font> ScaleFont<F> for PxScaleFont<F>
source§fn codepoint_ids(&self) -> CodepointIdIter<'_> ⓘ
fn codepoint_ids(&self) -> CodepointIdIter<'_> ⓘ
Returns an iterator of all distinct
(GlyphId, char)
pairs. Not ordered. Read moresource§fn h_scale_factor(&self) -> f32
fn h_scale_factor(&self) -> f32
Scale factor for unscaled font horizontal values.
source§fn v_scale_factor(&self) -> f32
fn v_scale_factor(&self) -> f32
Scale factor for unscaled font vertical values.
fn scale_factor(&self) -> PxScaleFactor
source§fn ascent(&self) -> f32
fn ascent(&self) -> f32
Pixel scaled glyph ascent. See glyph layout concepts.
source§fn descent(&self) -> f32
fn descent(&self) -> f32
Pixel scaled glyph descent. See glyph layout concepts.
source§fn line_gap(&self) -> f32
fn line_gap(&self) -> f32
Pixel scaled line gap. See glyph layout concepts.
source§fn scaled_glyph(&self, c: char) -> Glyph
fn scaled_glyph(&self, c: char) -> Glyph
source§fn h_advance(&self, id: GlyphId) -> f32
fn h_advance(&self, id: GlyphId) -> f32
Pixel scaled horizontal advance for a given glyph.
See glyph layout concepts.
source§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.
See glyph layout concepts.
source§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.
source§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.
source§fn glyph_bounds(&self, glyph: &Glyph) -> Rect
fn glyph_bounds(&self, glyph: &Glyph) -> Rect
Returns the layout bounds of this glyph. Read more
source§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()
source§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> Copy for PxScaleFont<F>
Auto Trait Implementations§
impl<F> Freeze for PxScaleFont<F>where
F: Freeze,
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)