pub struct FontFace {
name: String,
font: FontCell,
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§font: FontCell§tweak: FontTweak§glyph_info_cache: HashMap<char, GlyphInfo>§glyph_alloc_cache: HashMap<GlyphCacheKey, GlyphAllocation>Implementations§
Source§impl FontFace
impl FontFace
pub fn new( options: TextOptions, name: String, font_data: Arc<dyn AsRef<[u8]> + Send + Sync>, index: u32, tweak: FontTweak, ) -> Result<Self, Box<dyn Error>>
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: &StyledMetrics, last_glyph_id: GlyphId, glyph_id: GlyphId, ) -> f32
pub fn pair_kerning( &self, metrics: &StyledMetrics, last_glyph_id: GlyphId, glyph_id: GlyphId, ) -> f32
pub fn styled_metrics( &self, pixels_per_point: f32, font_size: f32, coords: &VariationCoords, ) -> StyledMetrics
pub fn allocate_glyph( &mut self, atlas: &mut TextureAtlas, metrics: &StyledMetrics, glyph_info: GlyphInfo, chr: char, h_pos: f32, ) -> (GlyphAllocation, i32)
Auto Trait Implementations§
impl Freeze for FontFace
impl !RefUnwindSafe for FontFace
impl Send for FontFace
impl Sync for FontFace
impl Unpin for FontFace
impl UnsafeUnpin for FontFace
impl !UnwindSafe for FontFace
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