Struct sdl2_ttf::Font
[−]
[src]
pub struct Font { // some fields omitted }
The opaque holder of a loaded font.
Methods
impl Font
[src]
fn from_file(filename: &Path, ptsize: i32) -> SdlResult<Font>
Load file for use as a font, at ptsize size.
fn from_file_index(filename: &Path, ptsize: i32, index: i32) -> SdlResult<Font>
Load file, face index, for use as a font, at ptsize size.
fn get_style(&self) -> FontStyle
Get font render style
fn set_style(&mut self, styles: FontStyle)
Set font render style.
fn get_outline(&self) -> i32
Get font outline width.
fn set_outline(&mut self, outline: i32)
Set font outline width.
fn get_hinting(&self) -> Hinting
Get freetype hinter setting.
fn set_hinting(&mut self, hinting: Hinting)
Set freetype hinter setting.
fn get_kerning(&self) -> bool
Get freetype kerning setting.
fn set_kerning(&mut self, kerning: bool)
Set freetype kerning setting.
fn height(&self) -> i32
Get font maximum total height.
fn ascent(&self) -> i32
Get font highest ascent (height above base).
fn descent(&self) -> i32
Get font lowest descent (height below base).
fn line_skip(&self) -> i32
Get font recommended line spacing.
fn faces(&self) -> i32
Get the number of faces in a font.
fn face_is_fixed_width(&self) -> bool
Get whether font is monospaced or not.
fn face_family_name(&self) -> Option<String>
Get current font face family name string.
fn face_style_name(&self) -> Option<String>
Get current font face style name string.
fn index_of_char(&self, ch: char) -> Option<i32>
Get individual font glyph availability.
fn metrics_of_char(&self, ch: char) -> Option<GlyphMetrics>
Get individual font glyph metrics.
fn size<'a, T>(&self, text: T) -> SdlResult<(u32, u32)> where T: Into<Text<'a>>
Get the size of the given text piece when rendered using this font
fn render<'a, T>(&self, text: T, mode: RenderMode) -> SdlResult<Surface> where T: Into<Text<'a>>
Attempt to render the given text to a SDL surface with the given mode. The text argument can be either a &str, a &[u8] latin-1 array or a char (This is because the Into trait has been implemented for these types)
Trait Implementations
impl PartialEq for Font
[src]
fn eq(&self, __arg_0: &Font) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Font) -> bool
This method tests for !=
.