Struct font_atlas::rasterize::Font
[−]
[src]
pub struct Font { /* fields omitted */ }
A single font loaded from a file.
Methods
impl Font
[src]
fn new(rusttype_font: Font<'static>) -> Font
[src]
Construct a new Font from a rusttype::Font.
fn render_char(&self, chr: char, scale: f32) -> Option<(CharInfo, Bitmap)>
[src]
Renders a character from this font at a given scale into a pair of (CharInfo, Bitmap).
If the character isn't handled by the font, None is returned.
fn make_atlas<I: Iterator<Item = char>>(
&self,
i: I,
scale: f32,
margin: u32,
width: usize,
height: usize
) -> (Atlas, Bitmap, f32)
[src]
&self,
i: I,
scale: f32,
margin: u32,
width: usize,
height: usize
) -> (Atlas, Bitmap, f32)
Creates an atlas for a set of characters rendered at a given scale.
margin
is the distance between characters in pixels.
width
and height
denote the starting size of the bitmap.
The resulting bitmap may be larger than width x height in order to fit all of the characters.
Trait Implementations
impl Clone for Font
[src]
fn clone(&self) -> Font
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more