pub struct FontFace {Show 19 fields
pub family: String,
pub style: FontStyle,
pub units_per_em: u32,
pub ascent: f32,
pub descent: f32,
pub line_gap: f32,
pub cap_height: f32,
pub x_height: f32,
pub underline_position: f32,
pub underline_thickness: f32,
pub strikethrough_position: f32,
pub strikethrough_thickness: f32,
pub glyphs: HashMap<u32, GlyphMetrics>,
pub kerning: Vec<KerningPair>,
pub render_mode: FontRenderMode,
pub hinting: FontHinting,
pub atlas_size: u32,
pub sdf_range: f32,
pub tab_width: u32,
}Fields§
§family: String§style: FontStyle§units_per_em: u32§ascent: f32§descent: f32§line_gap: f32§cap_height: f32§x_height: f32§underline_position: f32§underline_thickness: f32§strikethrough_position: f32§strikethrough_thickness: f32§glyphs: HashMap<u32, GlyphMetrics>§kerning: Vec<KerningPair>§render_mode: FontRenderMode§hinting: FontHinting§atlas_size: u32§sdf_range: f32§tab_width: u32Implementations§
Source§impl FontFace
impl FontFace
pub fn new(family: impl Into<String>, style: FontStyle) -> Self
pub fn line_height(&self, size: f32) -> f32
pub fn scale_for_size(&self, size: f32) -> f32
pub fn kerning_for_pair(&self, first: u32, second: u32) -> f32
pub fn glyph(&self, codepoint: u32) -> Option<&GlyphMetrics>
Sourcepub fn populate_ascii(&mut self)
pub fn populate_ascii(&mut self)
Populate with synthetic ASCII glyphs.
pub fn measure_text(&self, text: &str, size: f32) -> Vec2
Trait Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.