Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#4836 - Font scaling in wps

Attached to Project: Rockbox
Opened by Mark Arigo (lowlight) - Wednesday, 15 March 2006, 17:46 GMT+2
Last edited by Peter D'Hoye (petur) - Friday, 03 August 2007, 22:42 GMT+2
Task Type Patches
Category Themes
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This is support for simple font scaling on the wps screen.
I've posted some screenshots in the forum: http://forums.rockbox.org/index.php?topic=2856.0

By simple font scaling, I mean that the font characters are just increased by a factor of 2 or 3 (or more). No anti-aliasing is done, so most of the font's will look pixelated when displayed larger than their native size.

I've only tested this on the H120/140 + remote, so this only patches the lcd code for that platform. I only changed generic code for the lcds, hence, I think the code should be easily portable to the other targets.

To use font scaling on the wps screen, use the syntax %h2 or %h3 to increase the font size by a factor of 2 or 3. This affects all the text on that line (you can't scale just part of the line). IMPORTANT: if you use %h2, leave the next line empty in the wps file. If you use %h3, leave the next 2 lines blank. (This is necessary because the wps and lcd code is line-based.) Also, you can scroll scaled text.

I'll be the first to admit that scaling most of the fonts does not produce a nice effect. However, the "snap" font does look good (see the screen shots). I also don't know if (or how much) the font scaling affects performance.

Let me know what you think.
(application/octet-stream)    font_scale.patch (17.8 KiB)
 firmware/font.c                    |   95 +++++++++++++++++++++++++++++++++++--
 firmware/export/font.h             |    4 +
 firmware/export/lcd.h              |    3 +
 firmware/drivers/lcd-h100.c        |   41 +++++++++++----
 firmware/export/lcd-remote.h       |    2 
 firmware/drivers/lcd-h100-remote.c |   42 +++++++++++-----
 apps/screen_access.h               |    2 
 apps/screen_access.c               |    4 +
 apps/gui/gwps-common.c             |   26 ++++++++--
 tools/convbdf.c                    |    6 +-
 10 files changed, 192 insertions(+), 33 deletions(-)

This task depends upon

Closed by  Peter D'Hoye (petur)
Friday, 03 August 2007, 22:42 GMT+2
Reason for closing:  Rejected
Additional comments about closing:  waiting for multi-font....
Comment by Karl Lurman (Dent) - Tuesday, 21 March 2006, 04:00 GMT+2
I think it would be better if all fonts were anti-aliased anyway - or certainly if the platform supports it and the user requests the feature enabled. As I am not much of a C coder and have only a limited knowledge of the structure of RockBox, Im not sure where changes would need to occur to make this possible. I assume that the Graphics API has some kind of text rendering function. Could it be possible that an anti-aliasing algorithm could be introduced here? It would be nice if TrueType font rendering could be introduced. How much of a performance hit would this be? Perhaps as an intermediate step, rasterized fonts with pre-rendered anti-aliasing could be introduced (?) This would give theme developers the freedom to create some pretty cool Amiga-like fonts...

Thanks for your work on this stuff!
Comment by glam (b00st4) - Thursday, 30 March 2006, 22:51 GMT+2
doesnt work anymore..
Comment by Michael Hahn (disorganizer) - Friday, 15 June 2007, 12:48 GMT+2
wouldnt it be easier to allow multiple fonts in one wps?
like preloading a small and a large font to show all the "unnecessary" detail in the small font (codex, size etc.) and the important info (song title) in a bigger font?

Loading...