Map Database  •  FAQ  •  RSS  •  Login

Editing FNT (fonts) files Video Tutorial [80% done]

<<

Greninho

Woodcutter

Posts: 19

Joined: 19 Mar 2009, 23:00

Location: Brasil

Post 31 Mar 2009, 16:37

Editing FNT (fonts) files Video Tutorial [80% done]

Editing FNT (fonts) files Video Tutorial

http://cleyton.110mb.com/Tutorial/
(Made with flash, 400kb~)
I think it will help someone to edit fnt files or to create a program to edit fnt file.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 31 Mar 2009, 22:29

I tried to write an editor for it but quickly found that letting the user draw is a biotch. If I make it a Paint.NET filetype plugin, would that be OK with everyone?

edit: progress update, loading now works
edit: non-progress, ok this is isn't going to work either. I think I'll just add fnt loading to the graphics editor and you will just have to edit the letters separately.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 15 Jul 2009, 18:46

Why don't just export all 256 letters to bmp and let user use MSPaint, then just pack all 256 bmps back into fnt - that should work good enough and easy to code :)
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 15 Jul 2009, 19:08

It's not easy, how can you tell the bounds of the letter? Dynamic programming of "best distribution of 256 rectangles that encompass all opaque pixels and the least possible number of transparent pixels" or something like that? (can that even be done with dynamic programming?)
It just kinda sucks. Exporting 256 bitmaps would be easy, but that causes major suckage for the editor..
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 15 Jul 2009, 19:28

Why do the distribution? Just make all letterboxes the same size :wink: we don't need optimization for 256 boxes, are we?

Actualy thats an idea: export 1 bmp with fixed size letter boxes (e.g. specified at export stage). User will specify size he wants to draw into (32x16 should be quite enough). Find maximum required sizes when packing everything back to fnt and stack all letters (remove transparent pixels on sides and bottom).

P.S. The reason I bump the topic - we add multilang to Remake and some fonts (Russian to be specific) are way off standard. Besides we could add new Greek/Brazil locales if we had the fonts as well. I would've coded the font tool, but I'm too busy with Remake.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 15 Jul 2009, 20:17

With the boxes all the same size, you wouldn't have the required width information (the height doesn't matter)
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 15 Jul 2009, 20:28

Width = width_of_all_non-transparent_pixels.
You can define one color as invisible in KaM, but visible in BMP, e.g. #FE
When packing back to fnt you set it to be transparent and include its pixels into width calculation. Do you get my idea?
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 15 Jul 2009, 20:59

Hm. might work. But I'm not sure the width is always exactly that (esp. in the case of a comma or | etc)?
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 05:07

Thats why I suggest this example:

OOTTTOOO
OOTTTOOO
OOTXTOOO
OOTXTOOO
OOTXTOOO
OOTXTOOO
OOTXTOOO
OOTXTOOO

See, X is where | symbol is, T means transparent pixels in fnt file which are also forming character area (height offset), O are transparent pixels forming uniform cell and not used in width/height calculation. Chat width is 3, height is 8, but 3 upper pixels will be transparent ingame.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Jul 2009, 16:39

So you'd have 2 types of transparent pixels? Ok I think I get it now, that should work
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 16:51

Exactly :)
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 19 Mar 2010, 13:12

We've made such Font Editor with Lewin :)
Does anyone wants to test it?
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 19 Mar 2010, 21:23

Sounds great, I think I could give it a spin :wink:
<<

Greninho

Woodcutter

Posts: 19

Joined: 19 Mar 2009, 23:00

Location: Brasil

Post 23 Mar 2010, 02:58

wow!! Great *--* I want test if possible

Return to “Other Creations”

Who is online

Users browsing this forum: No registered users and 10 guests