pub struct FontImpl {
name: String,
ab_glyph_font: FontArc,
tweak: FontTweak,
glyph_info_cache: HashMap<char, GlyphInfo>,
glyph_alloc_cache: HashMap<GlyphCacheKey, GlyphAllocation>,
}Expand description
A specific font face. The interface uses points as the unit for everything.
Fields§
§name: String§ab_glyph_font: FontArc§tweak: FontTweak§glyph_info_cache: HashMap<char, GlyphInfo>§glyph_alloc_cache: HashMap<GlyphCacheKey, GlyphAllocation>Implementations§
Source§impl FontImpl
impl FontImpl
pub fn new(name: String, ab_glyph_font: FontArc, tweak: FontTweak) -> Self
Sourcefn ignore_character(&self, chr: char) -> bool
fn ignore_character(&self, chr: char) -> bool
Code points that will always be replaced by the replacement character.
See also invisible_char.
Sourcefn characters(&self) -> impl Iterator<Item = char> + '_
fn characters(&self) -> impl Iterator<Item = char> + '_
An un-ordered iterator over all supported characters.
Sourcepub(super) fn glyph_info(&mut self, c: char) -> Option<GlyphInfo>
pub(super) fn glyph_info(&mut self, c: char) -> Option<GlyphInfo>
\n will result in None
pub(super) fn pair_kerning_pixels( &self, metrics: &ScaledMetrics, last_glyph_id: GlyphId, glyph_id: GlyphId, ) -> f32
pub fn pair_kerning( &self, metrics: &ScaledMetrics, last_glyph_id: GlyphId, glyph_id: GlyphId, ) -> f32
pub fn scaled_metrics( &self, pixels_per_point: f32, font_size: f32, ) -> ScaledMetrics
pub fn allocate_glyph( &mut self, atlas: &mut TextureAtlas, metrics: &ScaledMetrics, glyph_info: GlyphInfo, chr: char, h_pos: f32, ) -> (GlyphAllocation, i32)
Auto Trait Implementations§
impl Freeze for FontImpl
impl !RefUnwindSafe for FontImpl
impl Send for FontImpl
impl Sync for FontImpl
impl Unpin for FontImpl
impl !UnwindSafe for FontImpl
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