OpenArena Message Boards

Other projects => Pointless => Topic started by: fromhell on October 06, 2008, 12:08:46 PM



Title: [Hak] fontsize.lmp
Post by: fromhell on October 06, 2008, 12:08:46 PM
Can anyone analyze this specialized lump from Hexen 2?
Without it properly, I can't have the menu text aligned properly
(http://openarena.ws/fsfps/bigfont.gif)


Title: Re: fontsize.lmp
Post by: andrewj on October 06, 2008, 09:33:52 PM
Looking at the source code, if you remove the fontsize.lmp from the PAK the engine will create one for you.

The format is 27x27 matrix of bytes.
There is one row and one column for each letter A-Z and the '/' character.
It is really a kerning table, for each pair of letters it gives the first letter's width.
Spaces are hard-coded to 32 pixels wide.


Title: Re: fontsize.lmp
Post by: fromhell on October 06, 2008, 10:23:31 PM
Looking at the source code, if you remove the fontsize.lmp from the PAK the engine will create one for you.
Well of course, it's kinda hard to run the game when there is a checksum check in the engine (including Hammer of Thyrion). I am unable to compile and find out.

EDIT: 0 bytes on it recreates it
(http://openarena.ws/fsfps/bigfont2.gif)

well, it looks more correct now but still odd :(


Title: Re: fontsize.lmp
Post by: andrewj on October 20, 2008, 11:04:23 PM
Try moving all the characters left as far as possible in their 20x20 box,
i.e. their first pixel has an X coordinate which is 0,20,40,etc....

I'll add support for this to qpakman soon, it will unpack fontsize.lmp as a
text file (fontsize.txt), and reconverted when packed, so at least it can be
manually adjusted.