pub struct Font<'a> {
pub(super) fonts_by_id: &'a mut IntMap<FontFaceKey, FontImpl>,
pub(super) cached_family: &'a mut CachedFamily,
pub(super) atlas: &'a mut TextureAtlas,
}Expand description
Wrapper over multiple FontImpl (e.g. a primary + fallbacks for emojis)
Fields§
§fonts_by_id: &'a mut IntMap<FontFaceKey, FontImpl>§cached_family: &'a mut CachedFamily§atlas: &'a mut TextureAtlasImplementations§
Source§impl Font<'_>
impl Font<'_>
pub fn preload_characters(&mut self, s: &str)
Sourcepub fn characters(&mut self) -> &BTreeMap<char, Vec<String>>
pub fn characters(&mut self) -> &BTreeMap<char, Vec<String>>
All supported characters, and in which font they are available in.
pub fn scaled_metrics( &self, pixels_per_point: f32, font_size: f32, ) -> ScaledMetrics
Sourcepub fn glyph_width(&mut self, c: char, font_size: f32) -> f32
pub fn glyph_width(&mut self, c: char, font_size: f32) -> f32
Width of this character in points.
Sourcepub fn has_glyphs(&mut self, s: &str) -> bool
pub fn has_glyphs(&mut self, s: &str) -> bool
Can we display all the glyphs in this text?
Sourcepub(crate) fn glyph_info(&mut self, c: char) -> (FontFaceKey, GlyphInfo)
pub(crate) fn glyph_info(&mut self, c: char) -> (FontFaceKey, GlyphInfo)
\n will (intentionally) show up as the replacement character.
Auto Trait Implementations§
impl<'a> Freeze for Font<'a>
impl<'a> !RefUnwindSafe for Font<'a>
impl<'a> Send for Font<'a>
impl<'a> Sync for Font<'a>
impl<'a> Unpin for Font<'a>
impl<'a> !UnwindSafe for Font<'a>
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