[dev] Font edition tooling

From: mpu <quentin_AT_c9x.me>
Date: Tue, 22 Dec 2015 20:25:39 +0000

Hi folks,

I wrote some tools to design bitmap fonts. Maybe you'll
be interested.

  http://github.com/mpu/fnt/

(I know, it's Github, I'll move it some place
 reasonable if there's interest.)

Two C programs, 'edit' and 'view', allow respectively to
edit one glyph and view a text with the font currently
being designed. The 'view' tool can get bitten by SIGHUP
signals to refresh the view. To do this automatically
when the font gets changed, I made a little shell script
that uses inotify-tools to monitor the font directory
energy-efficiently, it is 'watch.sh'. When done editing
use the '2bdf.sh' shell script to convert the font to
BDF (usable by X11). It does not work for fonts wider
than 8 pixels, though, so you might have to patch it.

The font format is I think suckless, a font is simply
stored in a directory named WxH where W and H are the
pixel dimensions of the font. Each glyph is then
stored as an ASCII file named U+NNNN where NNNN is the
Unicode codepoint of the glyph. Here is what is stored
in 7x10/U+0041 (glyph 'A') for the leon font

.......
.xxx...
x...x..
x...x..
xxxxx..
x...x..
x...x..
x...x..
.......
.......

That way, a font can be stored using git and edited
using standard text-editors in a reasonable way.

I now use the font (leon) packaged in the git repo,
it was pretty fun to design.

-- mpu
Received on Tue Dec 22 2015 - 21:25:39 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 22 2015 - 21:36:10 CET