FS#7033 - Define line height in the WPS

Attached to Project: Rockbox
Opened by Nicolas Pennequin (nicolas_p) - Sunday, 15 April 2007, 12:40 GMT
Last edited by Jonathan Gordon (jdgordon) - Tuesday, 23 September 2008, 10:17 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 patch adds an %lh tag to the WPS that allows to define the line height.
The format is %lh|height| (the '|' at the end is mandatory).
With this tag added to a WPS, the lines will be of the specified height whatever the font chosen by the user.
If the font used is smaller than the defined line height, the text will be centered.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Tuesday, 23 September 2008, 10:17 GMT
Reason for closing:  Out of Date
Additional comments about closing:  this is less of an issue now the WPS has viewports so can probably be closed
Comment by Nicolas Pennequin (nicolas_p) - Monday, 16 April 2007, 23:04 GMT
A few minor updates, and the tag is now %ls because %lh was already taken (silly me !).
Comment by Dave Chapman (linuxstb) - Tuesday, 17 April 2007, 07:43 GMT
Going by the discussion in IRC (2007-04-17, starting at 00.12.56), there seem to be some objections to this patch, so I thought I would comment to say I'm in favour of committing it.

The code changes seem very minimal (mainly just replacing references to the font height to references to this new variable), and it implements two (IMO useful) features - 1) The ability for a WPS designer to specify a line-spacing; 2) The ability for a user to use slightly different sized fonts with an existing WPS without breaking the formatting wrt images. e.g. a user might want to use a smaller font in order to display more text without scrolling.

A side-effect is that WPSs are less broken when the user doesn't have the correct font installed, but I don't think that's the primary reason for committing this patch.
Comment by Nicolas Pennequin (nicolas_p) - Wednesday, 25 April 2007, 01:17 GMT
This patch has an issue with scrolling lines: they don't take the line height setting into account.
I will try to find a nice workaround, but it seems amiconn's viewports and LCD drivers rewrite will bring the true solution to this.
Comment by Nathan Hale (Incubus-1) - Sunday, 13 May 2007, 16:46 GMT
NicolasP, do you have time to sync this patch or have you abandoned it due to the mentioned viewports and LCD drivers rewrite?
Comment by Nicolas Pennequin (nicolas_p) - Sunday, 13 May 2007, 17:06 GMT
I haven't had the time to have a close look at the problem and I'm not sure I will in the next few days, but I'll try not to forget this patch :)
Until then, here is my latest version (I'm not sure there are some changes but at least it'll apply cleanly)
Comment by Nathan Hale (Incubus-1) - Sunday, 13 May 2007, 22:20 GMT
Cool! Thanks! I definitely understand there not being enough hours in the day. Thanks for the response, though.
Comment by Jonathan Gordon (jdgordon) - Tuesday, 08 January 2008, 05:37 GMT
here is my 30min half assed attempt at getting this working in the viewport code for 16-bit lcd. I gave up because I couldnt be bothered trying to get the selection bar working properly... if someone wants to fix it properly please go for it :)