Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: illux on June 28, 2010, 04:02:21 PM

Title: Adjustable font line height?
Post by: illux on June 28, 2010, 04:02:21 PM
Hi I'm new to this forum and new to rockbox

Regarding themeing, can the fonts line height be adjusted like you can in css?

The default font pack is really nice, but its difficult to read menus and text without a 1 or 2 pixel spacing between the lines. Is this possible within the themeing engine? or is this a feature for the rockbox wishlist in future?

Title: Re: Adjustable font line height?
Post by: bluebrother on June 28, 2010, 04:14:32 PM
Regarding themeing, can the fonts line height be adjusted like you can in css?

No.

Quote
The default font pack is really nice, but its difficult to read menus and text without a 1 or 2 pixel spacing between the lines.

I disagree with this (it definitely depends on the font itself), but of course that's also a matter of taste :) There was a patch for setting the line heigth in the wps quite a while ago, but that was rejected. Besides, it didn't affect the menus at all.
Title: Re: Adjustable font line height?
Post by: JdGordon on June 28, 2010, 07:13:24 PM
you could easily hack this up yourself, but as bluebrother said, it isnt likely to happen any time soon in svn.
Title: Re: Adjustable font line height?
Post by: illux on June 28, 2010, 07:31:39 PM
Thanks for the quick reply,

Instead of coding or hacking up a config, I was thinking of padding one of the default fonts with extra pixels. For example taking a 10 pixel font and adding a 1px row to the top and 1px row at the base and re-saving it as a 12px font to get a similar effect, Im not sure about how leading (character spacing) works yet.

It looks like the fonts are all square pixels, same width x height. Can the font rendering engine render a non-square bitmap .fnt like 10px by 12px?

Cheers, I'll google the rest & search the forums for .fnt conversions etc.
Title: Re: Adjustable font line height?
Post by: JdGordon on June 28, 2010, 09:22:45 PM
.fnt is just a converted .Bdf and it does support non square glyphs. They must all be the same height though
Title: Re: Adjustable font line height?
Post by: Yotto on June 28, 2010, 10:49:55 PM
They don't even need to all be the same width ("l" can be skinnier than "m", for example)
Title: Re: Adjustable font line height?
Post by: fml2 on July 07, 2010, 09:42:58 AM
The convbdf utility (which is used to convert .bdf files to .fnt files, i.e. to font files in rockbox format) has an option that does exactly what you need: change the height of the produced font (its ascent and descent) without changing the original input .bdf. I don't remember what are those options but they should be displayed if you run the utility without any parameters.
Title: Re: Adjustable font line height?
Post by: Giova on July 10, 2010, 01:33:00 AM
Those are the options:
Code: [Select]
-a N[%][!] Allow the ascent to grow N pixels/% to avoid glyph clipping
-d N[%][!] Allow the descent to grow N pixels/% to avoid glyph clipping
Use those like this:
Code: [Select]
./convbdf -a 80% -d 80% -f 16-Adobe-Helvetica.bdf
This is very usefull for touchscreen devices.
Title: Re: Adjustable font line height?
Post by: fml2 on July 20, 2010, 04:54:51 AM
Use those like this:
Code: [Select]
./convbdf -a 80% -d 80% -f 16-Adobe-Helvetica.bdf

I think, this syntax will do nothing if the font is designed properly. To really force the ascent/descent to grow you should add a "!" to the parameter. e.g. "-a 80%!".
Title: Re: Adjustable font line height?
Post by: chris_s on December 18, 2018, 11:36:33 AM
Im not sure about how leading (character spacing) works yet.
Did you ever find a solution for that? I'm also trying to increase the padding around list items. The aforementioned way of using convbdf certainly works great to increase the vertical padding between list items, but the text still bumps up against the left edge, with no room to breathe.
Title: Re: Adjustable font line height?
Post by: chris_s on December 19, 2018, 02:11:22 AM
Figured out a nice workaround using blank icons... Pretty much achieves the same effect. Awesome!  :D