Struct sdl2_ttf::Font [] [src]

pub struct Font {
    // some fields omitted
}

A loaded TTF font.

Methods

impl Font
[src]

fn render<'a>(&'a self, text: &'a str) -> PartialRendering<'a>

Starts specifying a rendering of the given UTF-8-encoded text.

fn render_latin1<'a>(&'a self, text: &'a [u8]) -> PartialRendering<'a>

Starts specifying a rendering of the given Latin-1-encoded text.

fn render_char<'a>(&'a self, ch: char) -> PartialRendering<'a>

Starts specifying a rendering of the given UTF-8-encoded character.

fn size_of(&self, text: &str) -> FontResult<(u32, u32)>

Returns the width and height of the given text when rendered using this font.

fn size_of_latin1(&self, text: &[u8]) -> FontResult<(u32, u32)>

Returns the width and height of the given text when rendered using this font.

fn size_of_char(&self, ch: char) -> FontResult<(u32, u32)>

Returns the width and height of the given text when rendered using this font.

fn get_style(&self) -> FontStyle

Returns the font's style flags.

fn set_style(&mut self, styles: FontStyle)

Sets the font's style flags.

fn get_outline_width(&self) -> u16

Returns the width of the font's outline.

fn set_outline_width(&mut self, width: u16)

Sets the width of the font's outline.

fn get_hinting(&self) -> Hinting

Returns the font's freetype hints.

fn set_hinting(&mut self, hinting: Hinting)

Sets the font's freetype hints.

fn get_kerning(&self) -> bool

Returns whether the font is kerning.

fn set_kerning(&mut self, kerning: bool)

Sets whether the font should use kerning.

fn height(&self) -> i32

Get font maximum total height.

fn ascent(&self) -> i32

Returns the font's highest ascent (height above base).

fn descent(&self) -> i32

Returns the font's lowest descent (height below base). This is a negative number.

fn recommended_line_spacing(&self) -> i32

Returns the recommended line spacing for text rendered with this font.

fn face_count(&self) -> u16

Returns the number of faces in this font.

fn face_is_fixed_width(&self) -> bool

Returns whether the font is monospaced.

fn face_family_name(&self) -> Option<String>

Returns the family name of the current font face.

fn face_style_name(&self) -> Option<String>

Returns the name of the current font face.

fn find_glyph(&self, ch: char) -> Option<u16>

Returns the index of the given character in this font face.

fn find_glyph_metrics(&self, ch: char) -> Option<GlyphMetrics>

Returns the glyph metrics of the given character in this font face.

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 !=.

impl Drop for Font
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more