Trait rich_sdl2_rust::ttf::font::RenderExt
source · pub trait RenderExt {
// Required methods
fn render(&self, text: &str, mode: RenderMode) -> Result<TtfSurface>;
fn render_wrapped(
&self,
text: &str,
wrap_length: u32,
mode: RenderMode
) -> Result<TtfSurface>;
fn render_glyph(&self, ch: char, mode: RenderMode) -> Result<TtfSurface>;
}
Expand description
An extension for rendering the text.
Required Methods§
sourcefn render(&self, text: &str, mode: RenderMode) -> Result<TtfSurface>
fn render(&self, text: &str, mode: RenderMode) -> Result<TtfSurface>
Renders the text into the TtfSurface
, or Err
on failure.
sourcefn render_wrapped(
&self,
text: &str,
wrap_length: u32,
mode: RenderMode
) -> Result<TtfSurface>
fn render_wrapped( &self, text: &str, wrap_length: u32, mode: RenderMode ) -> Result<TtfSurface>
Renders the wrapped text into the TtfSurface
, or Err
on failure.
sourcefn render_glyph(&self, ch: char, mode: RenderMode) -> Result<TtfSurface>
fn render_glyph(&self, ch: char, mode: RenderMode) -> Result<TtfSurface>
Renders the character into the TtfSurface
, or Err
on failure.