FS#4836 - Font scaling in wps

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


This is support for simple font scaling on the wps screen.
I've posted some screenshots in the forum:

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.
This task depends upon

Closed by  Peter D'Hoye (petur)
Friday, 03 August 2007, 20:42 GMT
Reason for closing:  Rejected
Additional comments about closing:  waiting for multi-font....
Comment by Karl Lurman (Dent) - Tuesday, 21 March 2006, 03:00 GMT
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, 20:51 GMT
doesnt work anymore..
Comment by Michael Hahn (disorganizer) - Friday, 15 June 2007, 10:48 GMT
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?