← Back

ofxBDF

github.com/duskvirkus/ofxBDF · @duskvirkus
OF 0.11 Typography 2D

Glyph Bitmap Distribution Format (or BDF) parser for openFrameworks.

3 0 Last commit 6y ago Created 7y ago

README

ofxBDF



Glyph Bitmap Distribution Format (or BDF) parser for openFrameworks.

Intended to parse BDF files and create bitmap fonts that can then be manipulated further if desired. As ofDrawBitmapString() exists this is mainly for using BDF data in alternative ways.

⚠️ Warnings



Installing



cd (into openframeworks/addons)
git clone --recurse-submodules https://github.com/figraham/ofxBDF.git


Should now be listed in your addons in project generator. Don't forget to #include "ofxBDF" in ofApp.h.

Usage



// in ofApp.h
ofxBDF bdf;

// in ofApp.cpp
bdf.setup("path/to/bdf/file");


After running setup on the ofxBDF class with a path, you can use bdf.draw(int scale) to draw the characters to display the font and verify that it loaded correctly.

Then you can get ofImages for each characters using bdf.chars[index].character.

Check out the code for more features. It's under 500 lines of code so it should be fairly self explanatory.

Examples



There is one simple example using the cherry font by turquoise-hexagon. (This is the reason for recursive clone).

Use project generator to import example and setup for your system. Then it should run, file an issue if it doesn't.

Useful Links



Get this addon

HTTPS
SSH