pub trait RaylibFont: AsRef<Font> + AsMut<Font> {
// Provided methods
fn base_size(&self) -> i32 { ... }
fn texture(&self) -> &Texture2D { ... }
fn chars(&self) -> &[GlyphInfo] { ... }
fn chars_mut(&mut self) -> &mut [GlyphInfo] { ... }
fn is_font_valid(&self) -> bool { ... }
fn export_font_as_code<A>(&self, filename: A) -> bool
where A: Into<OsString> { ... }
fn get_glyph_info(&self, codepoint: char) -> GlyphInfo { ... }
fn get_glyph_index(&self, codepoint: char) -> i32 { ... }
fn get_glyph_atlas_rec(&self, codepoint: char) -> Rectangle { ... }
fn measure_text(&self, text: &str, font_size: f32, spacing: f32) -> Vector2 { ... }
}Provided Methods§
fn base_size(&self) -> i32
fn texture(&self) -> &Texture2D
fn chars(&self) -> &[GlyphInfo]
fn chars_mut(&mut self) -> &mut [GlyphInfo]
Sourcefn is_font_valid(&self) -> bool
fn is_font_valid(&self) -> bool
Check if a font is valid
Sourcefn export_font_as_code<A>(&self, filename: A) -> bool
fn export_font_as_code<A>(&self, filename: A) -> bool
Export font as code file, returns true on success
Sourcefn get_glyph_info(&self, codepoint: char) -> GlyphInfo
fn get_glyph_info(&self, codepoint: char) -> GlyphInfo
Get glyph font info data for a codepoint (unicode character), fallback to ‘?’ if not found
Sourcefn get_glyph_index(&self, codepoint: char) -> i32
fn get_glyph_index(&self, codepoint: char) -> i32
Gets index position for a unicode character on font.
Sourcefn get_glyph_atlas_rec(&self, codepoint: char) -> Rectangle
fn get_glyph_atlas_rec(&self, codepoint: char) -> Rectangle
Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to ‘?’ if not found
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.