Struct glerminal::font::Font [] [src]

pub struct Font {
    pub name: String,
    pub line_height: u32,
    pub size: u32,
    // some fields omitted
}

Represents the font when it's loaded.

Fields

The name of the font

Line height of the font

Size of the font (width)

Methods

impl Font
[src]

[src]

Loads the font fron the given .sfl file, for example:

use glerminal::font::Font;
let font = Font::load("fonts/iosevka.sfl");

[src]

Loads the font from the given string (.sfl file contents) and Read (image read)

use glerminal::font::Font;
use std::fs::File;

let font = Font::load_raw(include_str!("../fonts/iosevka.sfl"), File::open("fonts/iosevka.png").unwrap());

[src]

Gets the CharacterData from the Font with the given char, if the charcter exists, otherwise returns an error as a String. Example:

use glerminal::font::Font;
let a_char_data = Font::load("fonts/iosevka.sfl").get_character('a');

Trait Implementations

impl Debug for Font
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for Font
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

Auto Trait Implementations

impl Send for Font

impl Sync for Font