pub struct FontsImpl {
pixels_per_point: f32,
max_texture_side: usize,
definitions: FontDefinitions,
atlas: Arc<Mutex<TextureAtlas>>,
font_impl_cache: FontImplCache,
sized_family: HashMap<(OrderedFloat<f32>, FontFamily), Font>,
}
Expand description
The collection of fonts used by epaint
.
Required in order to paint text.
Fields§
§pixels_per_point: f32
§max_texture_side: usize
§definitions: FontDefinitions
§atlas: Arc<Mutex<TextureAtlas>>
§font_impl_cache: FontImplCache
§sized_family: HashMap<(OrderedFloat<f32>, FontFamily), Font>
Implementations§
Source§impl FontsImpl
impl FontsImpl
Sourcepub fn new(
pixels_per_point: f32,
max_texture_side: usize,
definitions: FontDefinitions,
) -> Self
pub fn new( pixels_per_point: f32, max_texture_side: usize, definitions: FontDefinitions, ) -> Self
pub fn pixels_per_point(&self) -> f32
pub fn definitions(&self) -> &FontDefinitions
Sourcepub fn font(&mut self, font_id: &FontId) -> &mut Font
pub fn font(&mut self, font_id: &FontId) -> &mut Font
Get the right font implementation from size and FontFamily
.
Sourcefn glyph_width(&mut self, font_id: &FontId, c: char) -> f32
fn glyph_width(&mut self, font_id: &FontId, c: char) -> f32
Width of this character in points.
Sourcepub fn has_glyphs(&mut self, font_id: &FontId, s: &str) -> bool
pub fn has_glyphs(&mut self, font_id: &FontId, s: &str) -> bool
Can we display all the glyphs in this text?
Sourcefn row_height(&mut self, font_id: &FontId) -> f32
fn row_height(&mut self, font_id: &FontId) -> f32
Height of one row of text in points.
Returns a value rounded to emath::GUI_ROUNDING
.
Auto Trait Implementations§
impl Freeze for FontsImpl
impl !RefUnwindSafe for FontsImpl
impl Send for FontsImpl
impl Sync for FontsImpl
impl Unpin for FontsImpl
impl !UnwindSafe for FontsImpl
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