pub struct FontImpl {
name: String,
ab_glyph_font: FontArc,
scale_in_pixels: u32,
height_in_points: f32,
y_offset_in_points: f32,
ascent: f32,
pixels_per_point: f32,
glyph_info_cache: RwLock<HashMap<char, GlyphInfo>>,
atlas: Arc<Mutex<TextureAtlas>>,
}
Expand description
A specific font with a size. The interface uses points as the unit for everything.
Fields§
§name: String
§ab_glyph_font: FontArc
§scale_in_pixels: u32
Maximum character height
height_in_points: f32
§y_offset_in_points: f32
§ascent: f32
§pixels_per_point: f32
§glyph_info_cache: RwLock<HashMap<char, GlyphInfo>>
§atlas: Arc<Mutex<TextureAtlas>>
Implementations§
source§impl FontImpl
impl FontImpl
pub fn new( atlas: Arc<Mutex<TextureAtlas>>, pixels_per_point: f32, name: String, ab_glyph_font: FontArc, scale_in_pixels: f32, 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.
sourcefn glyph_info(&self, c: char) -> Option<GlyphInfo>
fn glyph_info(&self, c: char) -> Option<GlyphInfo>
\n
will result in None
pub fn pair_kerning(&self, last_glyph_id: GlyphId, glyph_id: GlyphId) -> f32
sourcepub fn row_height(&self) -> f32
pub fn row_height(&self) -> f32
Height of one row of text in points.
pub fn pixels_per_point(&self) -> f32
fn allocate_glyph(&self, glyph_id: GlyphId) -> GlyphInfo
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