basic_char/
basic_char.rs

1extern crate font_atlas;
2use font_atlas::*;
3
4fn main() {
5    let bytes = include_bytes!("Gudea-Regular.ttf");
6    let font = load_font_from_bytes(bytes.to_vec());
7    let (_, bitmap) = font.render_char('A', 40.0).unwrap();
8    for line in bitmap.lines() {
9        for &pixel in line {
10            if pixel == 0 {
11                print!(" ");
12            } else {
13                print!("#");
14            }
15        }
16        println!("");
17    }
18}