Rockbox mail archive
Subject: Re: converting old fonts started
From: Greg Haerr (greg_at_censoft.com)
: So I converted the old character tables (hex values are columns) into
: a bdf-like format (hex values are rows).
: oldfont.table table of the old .c source
: newfont.bdf my stupidly converted bfd
: newfont.bmp bmp that proofs that characters are ok somehow
: oldpropfont.table same as above
: newpropfont.bdf ..
: newpropfont.bmp ..
I'll take a look at these, I have some initial comments below.
: I'm no bdf expert and therefore I only took another bdf file and
: changed the character definitions with the output of my script.
: There are wrong values in these files because I don't know the
: meaning of the keywords inside the bdfs..
Here's the BDF specification, it's not small and a useful
: So the next step would be that a "bdf-expert" (I'm not! ;) ) makes
: correct bdf files out of these or someone tells me a good and simple
: (Windows) bdf program so that I can correct and complete these fonts.
Run the tools/bdf2c script "./bdf2c newfont.bdf > newfont.c"
and it will convert the files to a .c file for visual inspection
of the glyphs and origin offset. Later, you can run
and it will create newfont.fnt, which if copied to /system.fnt
will become the UI font (for simulator or real target)
You can replace firmware/X5x8.c with your .c file and
it will become the base compiled-in font.
: If someone wants the characters in the attached files slightly changed
: somehow because they're wrong (one pixel up, down,... other
: STARTCHAR/ENCODING count offset), write me and I'll send another file!
: I especially shifted the values of the newfont.bdf 3 pixels so that
: the bmp looks more correct, I don't know if this is right.
You need to change the ENCODING value to start
at 32, which is 0x20 (ascii space). Also, set
DEFAULT_CHAR to 32.
The DWIDTH value sets the individual font character width.
The BBX w h x y value sets the size of the included BITMAP
array in w,h, and the offset into the font at x,y. Normally,
you can use exactly the same values for all the characters
here except the w value, which should be the same as
DWIDTH since you're manually creating it.
: Hope that my approach helps..
It does, we can then have .bdf versions of the original fixed
and proportional fonts.
Take another pass at it and I'll check it with some other
bdf converters for correctness.
: Bye, Uwe.
Page was last modified "Jan 10 2012" The Rockbox Crew