bdf2

Crates.iobdf2
lib.rsbdf2
version
sourcesrc
created_at2024-12-08 05:39:48.871667
updated_at2024-12-08 05:39:48.871667
descriptionBDF format handling.
homepage
repositoryhttps://github.com/meh/rust-bdf
max_upload_size
id1476072
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
pest-ide-tools (github:pest-parser:pest-ide-tools)

documentation

README

bdf

Build & Test

BDF font handler

This crate allows you to read and write BDF fonts in Rust.

Example

This example will draw a given glyph in your terminal using the given font.

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

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");
}
Commit count: 95

cargo fmt