Font Creation Tutorial

In this tutorial, you will learn how to create your custom fonts for your MUGEN and how to install them. I assume that you have some knowledge about MUGEN and about ripping sprites. If you don't please refer to the documentation found in the Docs folder located in the MUGEN directory.
Making fonts in MUGEN is one of the easiest things you can do. But you'll need to do some steps before you have one font ready for your MUGEN

First of all, you should rip the font characters from any game as if they were sprites. I won't explain here how you should rip, because the method can vary depending on the emulator you have used.

example of a valid PCX

Then, you should make a PCX with the entire set of characters (i.e. from A to Z) put together in a row. As always, the PCX must be a 8 bit (256 colors indexed) with a masking color in the color 0 (i.e. the upper left color in PaintShop Pro's palette and the bottom right color in PhotoShop's one)
Now it comes the most important part of the tutorial. This is the part in which you should make the TXT. But before making the TXT, you MUST count the pixel where a letter starts and its width in pixels.

counting pixels

Those numbers would be used when making the TXT. The TXT would have the following structure.

; 6x9 variable width font
[Def]
Size = 8,8 ;size in pixels of the letters
Spacing = 0,0 ;space beetween letters
Colors = 16 ;color depth of the letter
Offset = 0,0
Type = Variable
; Character mapping:
; Char, Start_X, Width_of_char
; Special characters like semicolon (';') and open square brace ('[')
; must be represented as hexadecimal numbers (0x3B and 0x5B respectively)
[Map]
A 0 8 ;this means that letter A begins in pixel number 0 and has a width 
  of 8 pixels
B 8 8 ;Letter B begins in pixel number 8 and has a width of 8 pixels
C 16 7 ;Letter C begins in pixel number 16 and has a width of 7 pixels
D 23 8 ;Letter D begins 
  in pixel 23 and has a width of 8 pixels. And so on...
E 31 8
F 39 8
G 47 8
H 55 8
I 63 5
J 68 6
K 74 8
L 82 8
M 90 8
N 98 8
O 106 8
P 114 8
Q 122 8
R 130 8
S 138 7
T 145 8
U 153 8
V 161 8
W 169 10
X 179 8
Y 187 8
Z 195 8
a 0 8
b 8 8
c 16 7
d 23 8
e 31 8
f 39 8
g 47 8
h 55 8
i 63 5
j 68 6
k 74 8
l 82 8
m 90 8
n 98 8
o 106 8
p 114 8
q 122 8
r 130 8
s 138 7
t 145 8
u 153 8
v 161 8
w 169 10
x 179 8
y 187 8
z 195 8


As you can see, our custom font doesn't include lower case letters, but in our TXT definition we've included them (a 0 8 b 8 8 c 16 7...) Why? If MUGEN requires to use a character that is not included in the definition, MUGEN replaces it with a blank space. So, we define them, just to avoid letters disappearing while we are playing. Easy, right? Another valid solution would be to include the lower case letters in our PCX, but it happens sometimes, that the game we are ripping the letters from don't have them! So, we need to do that trick (^_^) Same happens with special characters such as / \ - + ? and so. If you want to include them in the PCX, but don't have them, you can always edit them!

Now we will learn how to compile our PCX and TXT into a FNT file. Just to tell you: MUGEN's FNT file format is not the same one as the Windows' FNT file format, so you can't put your windows fonts into your MUGEN directory.



First of all, open a MS-DOS dialog window. Then execute FNTMAKER. It will prompt you for a FNT file name. Put any name WITH an extension. That name will be the one of our font file. Then you'll need to insert the name of the PCX file we want to compile and the same with the TXT. After it, FNTMAKER would compile the new font. In any case, if FNTMAKER gives a "Error writing header", don't worry, the font will still work. As you can see, FNTMAKER has a similar interface as SPRMAKER.

That's all! If you have followed the instructions, you must have created a new font.
Now you must install the new font in your MUGEN, so you can enjoy it. Copy the new font in the data folder and open your SYSTEM.DEF, or FIGHT.DEF.
Fight.def refers to the fonts used during the fight (names, time, counter combo messages, etc...)
System.def refers to the ones used in the system program itself (select screen, options, main menu, etc...) Just replace the old font by the new one.