14 releases

0.6.0 Jul 20, 2020
0.5.5 Aug 26, 2016
0.5.4 Feb 22, 2016
0.5.3 Oct 29, 2015
0.5.2 Jul 19, 2015

#8 in Data formats

Download history 68/week @ 2020-04-10 34/week @ 2020-04-17 2/week @ 2020-04-24 1/week @ 2020-05-01 1/week @ 2020-05-08 2/week @ 2020-05-15 17/week @ 2020-05-22 17/week @ 2020-05-29 27/week @ 2020-06-05 2/week @ 2020-06-12 33/week @ 2020-06-19 2/week @ 2020-06-26 28/week @ 2020-07-03 39/week @ 2020-07-10 20/week @ 2020-07-17 7/week @ 2020-07-24

60 downloads per month
Used in mono_display

WTFPL license

43KB
1.5K SLoC

bdf

Build Status

BDF handling library.

[dependencies]
bdf = "*"

Example

This example will draw a given glyph in the given font.

extern crate bdf;

use std::env;
use std::process::exit;
use std::char;

fn main() {
	let font      = bdf::open(env::args().nth(1).expect("missing font file")).unwrap();
	let codepoint = char::from_u32(env::args().nth(2).expect("missing codepoint").parse().unwrap()).expect("invalid codepoint");
	let glyph     = font.glyphs().get(&codepoint).unwrap_or_else(|| exit(1));

	for y in 0 .. glyph.height() {
		for x in 0 .. glyph.width() {
			if glyph.get(x, y) {
				print!("██");
			}
			else {
				print!("  ");
			}
		}

		print!("\n");
	}
}

lib.rs:

BDF font handler.

Dependencies

~0.5–0.8MB
~19K SLoC