bdf 0.5.1

BDF format handling.
docs.rs failed to build bdf-0.5.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: bdf-0.6.0

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");
	}
}