Support and General Use > Theming and Appearance Customization

determine font pixel-heights

(1/3) > >>

lenny:
what is the easiest way to determine the pixel-height of a font?

bk:
http://www.rockbox.org/twiki/bin/view/Main/FontFormat

The height (16 bit value) is stored at an offset of 6 bytes.

edit: misread, actually 16 bit value

lenny:
I don't have the knowledge of how to read the 32 bit value offset 6 bytes in the header... How would I do that? All I'm trying to do is find an alternative to counting the pixels on the screen :P

Yotto:
I always look to see how many lines fit on the screen, and divide the screen height by that.

Not much better than counting pixels, but hey. :D

bk:
Here's a little program that outputs all the header information from a rockbox font file.

Compile with any ANSI C compiler (GCC on any platform should work) and use as follows:
fntinfo font.fnt



[attachment deleted by admin, too old]

Navigation

[0] Message Index

[#] Next page

Go to full version