[−][src]Struct sdl2::ttf::Font
A loaded TTF font.
Methods
impl<'ttf, 'r> Font<'ttf, 'r>[src]
pub fn render<'a, 'b>(&'a self, text: &'b str) -> PartialRendering<'a, 'b>[src]
Starts specifying a rendering of the given UTF-8-encoded text.
pub fn render_latin1<'a, 'b>(
&'a self,
text: &'b [u8]
) -> PartialRendering<'a, 'b>[src]
&'a self,
text: &'b [u8]
) -> PartialRendering<'a, 'b>
Starts specifying a rendering of the given Latin-1-encoded text.
pub fn render_char<'a>(&'a self, ch: char) -> PartialRendering<'a, 'static>[src]
Starts specifying a rendering of the given UTF-8-encoded character.
pub fn size_of(&self, text: &str) -> FontResult<(u32, u32)>[src]
Returns the width and height of the given text when rendered using this font.
pub fn size_of_latin1(&self, text: &[u8]) -> FontResult<(u32, u32)>[src]
Returns the width and height of the given text when rendered using this font.
pub fn size_of_char(&self, ch: char) -> FontResult<(u32, u32)>[src]
Returns the width and height of the given text when rendered using this font.
pub fn get_style(&self) -> FontStyle[src]
Returns the font's style flags.
pub fn set_style(&mut self, styles: FontStyle)[src]
Sets the font's style flags.
pub fn get_outline_width(&self) -> u16[src]
Returns the width of the font's outline.
pub fn set_outline_width(&mut self, width: u16)[src]
Sets the width of the font's outline.
pub fn get_hinting(&self) -> Hinting[src]
Returns the font's freetype hints.
pub fn set_hinting(&mut self, hinting: Hinting)[src]
Sets the font's freetype hints.
pub fn get_kerning(&self) -> bool[src]
Returns whether the font is kerning.
pub fn set_kerning(&mut self, kerning: bool)[src]
Sets whether the font should use kerning.
pub fn height(&self) -> i32[src]
Get font maximum total height.
pub fn ascent(&self) -> i32[src]
Returns the font's highest ascent (height above base).
pub fn descent(&self) -> i32[src]
Returns the font's lowest descent (height below base). This is a negative number.
pub fn recommended_line_spacing(&self) -> i32[src]
Returns the recommended line spacing for text rendered with this font.
pub fn face_count(&self) -> u16[src]
Returns the number of faces in this font.
pub fn face_is_fixed_width(&self) -> bool[src]
Returns whether the font is monospaced.
pub fn face_family_name(&self) -> Option<String>[src]
Returns the family name of the current font face.
pub fn face_style_name(&self) -> Option<String>[src]
Returns the name of the current font face.
pub fn find_glyph(&self, ch: char) -> Option<u16>[src]
Returns the index of the given character in this font face.
pub fn find_glyph_metrics(&self, ch: char) -> Option<GlyphMetrics>[src]
Returns the glyph metrics of the given character in this font face.
Trait Implementations
Auto Trait Implementations
impl<'ttf_module, 'rwops> RefUnwindSafe for Font<'ttf_module, 'rwops>
impl<'ttf_module, 'rwops> !Send for Font<'ttf_module, 'rwops>
impl<'ttf_module, 'rwops> !Sync for Font<'ttf_module, 'rwops>
impl<'ttf_module, 'rwops> Unpin for Font<'ttf_module, 'rwops>
impl<'ttf_module, 'rwops> UnwindSafe for Font<'ttf_module, 'rwops>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,