Rockbox mail archive
Subject: Re: Chinese, Japanese, Korean rockbox
From: Greg Haerr (greg_at_censoft.com)
> This font format omits offsets. The width is placed
> just before the image, enabling a single read.
> Each image is stored in the file as maxwidth * height
> (adjusted for rotation) so file positions are easily
Yes - I can see this format is better suited towards
fonts that will likely always be too large to be always
in-core, like the large Chinese fonts. But this format
is ill-suited to quick access for an in-core font structure.
So I propose that there be two font formats -
the existing one (possibly with a slight rev to version
number for a few extra bits, see below), and your
new "disk-based" format, used only for fonts that
are deemed to large for in-core use. In this way
we won't require smaller fonts to always require more
> Adding the CHARSET_REGISTRY is also useful. This
> allows the tree and wps to display Unicode and Big5 strings
> at the same time.
Good idea. Perhaps we should use flag bits rather than
a string, for ease of comparison rather than having to
use strcmp? Also, CHARSET_ENCODING might
be useful if we plan on knowing more about the font
for display usage.
> I'm open to suggestions on non-bdf font formats. If
> you know of something that is close to what's been
> described, then I'd be happy to investigate.
It's probably best that we try to stay somewhat
close to the existing format, since then we can
easily extend the existing tools to write both
font formats. Non-bdf sourced fonts would get
converted to the .fnt (style 1 or 2) format.
> Putting everything together, here's a preliminary file
> UCHAR version // version number incremented by one
> UCHAR name
> UCHAR copyright
> UCHAR charset_name
ULONG flags // font flags: style 1/2 (ram or disk), pre-rotated,
ULONG charset // add quick-access flag bits for charset
> USHORT maxwidth
> USHORT height
> USHORT ascent
USHORT pad // good idea to keep hdr 32-bit aligned
> ULONG firstchar
> ULONG defaultchar
> ULONG size
> Repeated structure size times
> UCHAR width
> MWIMAGEBITS bits
Do you think we need to worry about whether the imagebits
words need to be byte-swapped or not?
Page was last modified "Jan 10 2012" The Rockbox Crew