dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Chinese, Japanese, Korean rockbox

Re: Chinese, Japanese, Korean rockbox

From: Greg Haerr <>
Date: Fri, 21 Mar 2003 23:12:52 -0800

> 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
> calculated.

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
memory space.

> 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
> description.
> UCHAR version[4] // version number incremented by one
> UCHAR name[64]
> UCHAR copyright[256]
> UCHAR charset_name[32]
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

Do you think we need to worry about whether the imagebits
words need to be byte-swapped or not?


Received on 2003-03-22

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy