Module glerminal::font [] [src]

This module is used to load fonts that can be used in the TextBuffer

The Font can be loaded from an .sfl file and then used in the TextBuffer, in example:

use glerminal::terminal::TerminalBuilder;
use glerminal::font::Font;

let mut terminal = TerminalBuilder::new()
    .with_title("Hello glerminal::font::Font!")
    .with_dimensions((1280, 720))
    .with_font(Font::load("fonts/iosevka.sfl"))
    .with_headless(true)
    .build();

Alternatively you can use load_raw to load the font straight with include_str! and include_bytes!, example:

use glerminal::terminal::TerminalBuilder;
use glerminal::font::Font;

static IOSEVKA_SFL: &'static str = include_str!("../fonts/iosevka.sfl");
static IOSEVKA_PNG: &'static [u8] = include_bytes!("../fonts/iosevka.png");

let mut terminal = TerminalBuilder::new()
    .with_title("Hello glerminal::font::Font!")
    .with_dimensions((1280, 720))
    .with_font(Font::load_raw(IOSEVKA_SFL, IOSEVKA_PNG))
    .with_headless(true)
    .build();

Structs

CharacterData

Contains data of a single character in a Font

Font

Represents the font when it's loaded.