pub struct FontInfo { /* private fields */ }
Expand description
A font to be fed to the ImGui atlas.
Implementations§
Source§impl FontInfo
impl FontInfo
Sourcepub fn new(ttf: impl Into<Cow<'static, [u8]>>) -> FontInfo
pub fn new(ttf: impl Into<Cow<'static, [u8]>>) -> FontInfo
Creates a new FontInfo
from a TTF content and a font size.
Sourcepub fn set_name(self, name: impl Into<String>) -> Self
pub fn set_name(self, name: impl Into<String>) -> Self
Sets the name of this font.
It is used only for diagnostics and the “demo” window.
Sourcepub fn set_size(self, size: f32) -> Self
pub fn set_size(self, size: f32) -> Self
Sets the legacy size of this font.
The size of the default font (the first one registered) is saved
as the default font size. Any other font size is not actually used,
although it is visible as Font:.LegacySize
.
Sourcepub fn default_font() -> FontInfo
pub fn default_font() -> FontInfo
Creates a FontInfo
using the embedded default Dear ImGui font.
Sourcepub fn custom<GL: GlyphLoader + 'static>(glyph_loader: GL) -> FontInfo
pub fn custom<GL: GlyphLoader + 'static>(glyph_loader: GL) -> FontInfo
Registers a custom font loader.
A custom font loader is any static type that implements the trait GlyphLoader
.
Auto Trait Implementations§
impl Freeze for FontInfo
impl !RefUnwindSafe for FontInfo
impl !Send for FontInfo
impl !Sync for FontInfo
impl Unpin for FontInfo
impl !UnwindSafe for FontInfo
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