pub struct Font { /* private fields */ }Expand description
TTF font loaded to GPU
Implementations§
Source§impl Font
impl Font
Sourcepub fn ascii_character_list() -> Vec<char>
pub fn ascii_character_list() -> Vec<char>
List of ascii characters, may be helpful in combination with “populate_font_cache”
Sourcepub fn latin_character_list() -> Vec<char>
pub fn latin_character_list() -> Vec<char>
List of latin characters
pub fn populate_font_cache(&self, characters: &[char], size: u16)
Sourcepub fn set_filter(&mut self, filter_mode: FilterMode)
pub fn set_filter(&mut self, filter_mode: FilterMode)
Sets the FilterMode of this font’s texture atlas.
Use Nearest if you need integer-ratio scaling for pixel art, for example.
§Example
let mut font = get_default_font();
font.set_filter(FilterMode::Linear);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnsafeUnpin for Font
impl UnwindSafe 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