pub struct Font {
pub ab_font: FontArc,
pub type_face: String,
pub atlas: Arc<Mutex<Atlas>>,
pub scale: PhysicalPixelsF,
pub height: PhysicalPixelsF,
pub ascent: PhysicalPixelsF,
pub descent: PhysicalPixelsF,
pub line_gap: PhysicalPixelsF,
pub glyphs: Arc<Mutex<HashMap<char, Glyph>>>,
}Expand description
A font with a specific size.
Fields§
§ab_font: FontArc§type_face: String§atlas: Arc<Mutex<Atlas>>The atlas containing the rendered glyphs.
scale: PhysicalPixelsFThe scale factor for the font.
height: PhysicalPixelsF§ascent: PhysicalPixelsFhttps://docs.rs/ab_glyph/latest/ab_glyph/trait.Font.html#glyph-layout-concepts
descent: PhysicalPixelsFhttps://docs.rs/ab_glyph/latest/ab_glyph/trait.Font.html#glyph-layout-concepts
line_gap: PhysicalPixelsFhttps://docs.rs/ab_glyph/latest/ab_glyph/trait.Font.html#glyph-layout-concepts
glyphs: Arc<Mutex<HashMap<char, Glyph>>>A cached list of glyphs in the atlas.
Implementations§
Source§impl Font
impl Font
pub fn new( ab_font: FontArc, type_face: String, scale: LogicalPixels, scale_factor: ScaleFactor, ) -> Self
pub fn get_glyph(&self, c: char) -> Glyph
pub fn kern(&self, left: &Glyph, right: &Glyph) -> PhysicalPixelsF
pub fn get_atlas_pixels(&self) -> Vec<u8> ⓘ
pub fn get_atlas_size(&self) -> PhysicalPixelsSize
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Font
impl !UnwindSafe for Font
impl Freeze for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
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