Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Thoughts on Multiple Fonts in Rockbox

Thoughts on Multiple Fonts in Rockbox

From: Daniel Stenberg <daniel_at_rockbox.org>
Date: Thu, 18 Aug 2005 11:31:05 +0200 (CEST)

Hi

I've been thinking on how we could add support for multiple fonts within
Rockbox the best possible way. To allow users to fully customize fonts all
over the UI, including having multiple ones present on the same screen (the
WPS being the most notable case).

This is just my thoughts. Feel free to brainstorm, provide your own ideas or
just extend mine.

How about something like the following?

We have a font cache with named fonts (like "uwe-prop14", "chicago12" and
"alt6x10"). The cache fits N fonts, where N must be at least the number of
simultaneous fonts we support (which _could_ be dynamic so that we support 6
small fonts or 2 big ones etc).

Internally, we have a long list of font ID to font name mappings. Like

  FONT_RADIO
  FONT_DIRBROWSE
  FONT_MENU

Each of these can be set to a specific font name by the user (through a config
file). Of course, if a font is to be used that isn't already in the cache, it
will get loaded into the cache from disk (and the least recently used font
gets discarded from the cache if the new one doesn't fit).

The system built-in font has its own font name (like "default" or so) which
means that using that won't occupy space in the font cache at all.

For the WPS screen, I imagine what we have multiple symbolic names that could
be used like:

  FONT_WPS1
  FONT_WPS2
  FONT_WPS3
  FONT_WPS4

... and let's assume that WPS1 is the smallest and WPS4 is the biggest. Using
this, a WPS designer can use 4 sizes, while a user of such a WPS can still
elect exactly what fonts to use for those sizes.

More thoughts:

  Italic/Bold - shall we support such styles to a given font or shall we just
force users to just specify a font with these characteristics instead? These
styles can get made on a font run-time and thus not wasting any extra space
for them, but is it worth the extra code?

-- 
  Daniel Stenberg -- http://www.rockbox.org/ -- http://daniel.haxx.se/
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-08-18

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