Page 1 of 2

New Tool - Font Editor for KaM

PostPosted: 20 Mar 2010, 08:36
by Krom
Since some time we with Lewin been making this new tool for KaM modding: Font Editor :)

Here's how it works:
Place FontEd into KaM folder (it could be KaM Remake folder as well) and run it.
The tool will scan fonts folder and show all available fonts, you can view them in a GraphicsReader manner.
You can export BMPs, edit them in MSPaint/Photoshop/etc and import back - then updated font file can be saved :)
Also you can type a sample phrase to see how it looks in KaM fonts :)

Fonts connection with palettes in FontEd is hardcoded and can't be changed yet.
On export used palette will be appended to bmp file, so you can see what colors are safe to use.

Some pics :)
Image
Image

Download will be available soon at:
http://code.google.com/p/castlesand/downloads/list

PostPosted: 20 Mar 2010, 23:06
by Danjb
Awesome!

It's thanks to you guys that we can keep this classic game alive :D
Great work :)

PostPosted: 21 Mar 2010, 09:45
by Litude
Fantastic work on the font editor, has pretty much everything you could possibly expect from one :wink:.

Just one problem, when I put it into my TPR folder, the following fonts are completely black: adam.fnt, font01.fnt, kmlobby1.fnt, kmlobby2.fnt, maina.fnt, mainb.fnt, mainmapgold.fnt, mini.fnt, minimum.fnt and system.fnt. Putting the FontEditor into the KaM Remake folder yields better results (a few are still black though) but it seems to include a bunch of font files that aren't present in TPR.

PostPosted: 21 Mar 2010, 14:36
by Krom
Although Remake uses just 3-4 fonts we did placed all fonts from TSK/TPR we could find :)

As for black fonts - they are using unknown palette for they look same strange with all palettes... I will add a palette selector to FontEd for you to see :)

EDIT:
Fresh version uploaded to google.code place :)

PostPosted: 23 Mar 2010, 03:27
by Greninho
very good!!! i will test when I take some time >_<

PostPosted: 23 Mar 2010, 14:18
by Litude
Whipped up a modification of antiqua.fnt to make the character encoding match with ISO/IEC 8859-15 as a test. The tool worked pretty much perfectly, you can see the result below:

Image

This should make redesigning the Russian fonts oh so much easier, thanks a lot both to Lewin and you for going through and making this tool!

One feature that would be nice would be to somehow be able to force an empty line (e.g. after a character). Currently the non-breaking space character gets removed when exporting the bitmap and then importing it again.

PostPosted: 23 Mar 2010, 14:49
by Krom
There was a bug with displaying character width/height in FontEd status bar, I'll fix it.

Litude, can you tell me - whats the character code for non-breaking space? Did you tested it in KaM - that resaving font ommits space width?

PostPosted: 23 Mar 2010, 15:24
by Litude
7F gives a non-breaking space with antiqua.fnt (the only font that needs one). I tested the font file I created above in-game and when there was supposed to be a non-breaking space the game didn't print anything, so the character didn't exist.

PostPosted: 27 Mar 2010, 08:49
by Krom
FontEd updates:
Added possibility to view unicode fonts
Added option to see non-breaking space width

I will upload it in few minutes

PostPosted: 01 Apr 2010, 10:53
by Krom
Font Editor for KaM (r799) is released:
Added option to edit individual letters Y offset (which is handy for fixing Russian fonts, for some letters should have different offsets)

PostPosted: 28 Apr 2010, 07:06
by Litude
Using the FontEditor to edit the Russian fonts has made a troublesome job into a mere matter of altering a few pixels in paint, thanks a lot for the tool! :D

Anyway, there are a few bugs which I thought I'd report. Firstly, altering the NB space width does nothing as the tool doesn't seem to save the option.

Secondly, sometimes exporting and importing a font will make the font use different palette entries than the original font did (I guess this is cases where a color exists twice or more than twice in the same palette, which could make this problem more or less impossible to fix). This can cause problems with e.g. maina.fnt which doesn't use any of the palettes available but one hardcoded into the game EXE.
Even when using the original colors when exporting with the mapgold palette, the colors end up slightly messed up when importing the bitmap and using the font in the game (trough trial and error it's possible to find alternate palettes which seem to keep the palette entries, e.g. pal0 in this case).

PostPosted: 28 Apr 2010, 10:29
by Krom
Thanks for report Litude! I've added it to KaM Remake buglist at google.code :)

PostPosted: 01 May 2010, 13:26
by TokraOx
I simply had to register to this forum just to say: THANKS! People play this game all over the world and you keep making it better and better every single day and more interesting to all of us and what's more important you are keeping it alive! :P

:arrow: I'm really interested in translating your version in slovenian language, becouse a lot of people play it here. I gess that will also make a great contribution in popularity of your version in Slovenia.

PostPosted: 21 Aug 2010, 04:15
by Ben
Hey this looks pretty interesting, but I'm even more interested in getting KaM font on word pad. Is it possible?

PostPosted: 23 Aug 2010, 08:14
by Krom
Don't know exact tools, but it is possible to have bitmap fonts in Windows, see e.g. System font.