Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Creating call of duty fonts from stock
#1
Hey.
This tutorial will show you how to create new fonts for any call of duty title available.
(You will need the font raw files from the modding tools/ff.

Since I've added a new language to the mod I'm building, I had to add new letters which was not existed on call of duty, so I needed to understand the font binary files structure (which is very simple.)

You will need the next tools:
1. Photoshop
2. Hex editor (Hex workshop recommended)
3. Diego Logic's Cod font explorer
4. Iwi2dds
5. TGA/DDS to iwi (I'm using the mod tools asset manager)

Choosing the font file to modify
the fonts files are located at the raw/fonts path (or English/fonts)
most of the fonts are the same for the last titles of cod.

   

These are the standard fonts.
(there is no way to find which font is used in what string in-game, only by checking the menu file at ui_mp, or just messing with one of the fonts until you see which one is changing.

Exploring the fonts
first, you will have to find and convert the "gamefont_pc.iwi" file in one of the localized iwd files at the main folder (most of the time at the first one).
Convert this file to .dds using iwi2dds tool
and save 2 versions of file, in the first version copy the alpha channel to the RGB channel and save it on the name "gamefont_pc.bmp", in the second one, leave only the alpha channel and save it as TGA 32BIT.
Copy the desired font binary file to your mod folder root /fonts and also the bmp file created before. (The bmp file is used byt he explorer tool to view the image, you will need to update the bmp file after every time you change the tga.)

Choose your font and open it with Diego logic's font explorer as you can see, the font binary file is connected to the gamefonts_pc image, and tells the game where every letter located, what's the size of each letter, and how much space to give it when printing.

When pressing on the     icon you will be able to see the image, and choose the letter to show its coordinates.
Modifying the fonts
Open the gamefont_pc.tga file in Photoshop, and choose the letter you want to edit.
After editing (unless you kept the exact letter size and location), the existed properties will be no longer valid to the new letter. So now you will have to change it.

Open the binary font file with hex workshop, and look for the letter you've just changed.
You will have to look for the letter code, you can see all the language codes for English language at the table below:
http://ascii.cl/htmlcodes.htm (ASCII HEX)
in this case the letter that I want to change is capital A (for BIGFONT), and the code for the letter is 41.
Press on Edit>Find>HEX Values>4100 (always add two zeros after the code).
each letter has 24 bytes:

   

4100 is the char code (above-mentioned)
00 is the left spacing which is 0
D2 is the top spacing which is -46
19 is the right spacing which is 25

1C = 29 (Width)
24 = 36 (Height)

this is the same values you will get when viewing from the explorer tool
*notice the right spacing will always be the letter width + space, so it means that if A capital is 29 pixels long and the right spacing is 24, it will have a -5 pixels of space to the right.

The left space you should be at 0 unless you have too much space on the left side of the letter. Same for the top (best way is to trial and error).
In order to convert the Hex to decimal you have 2 ways. One is just selecting the byte and on the left windows of the program (data inspector) look what the "int8" value is.
The other way is to use the base converter

   

This only applies for the dimensions and spacing and not for the UV'S.

In order to view the value of the UVS, go to Options> Preferences> Precision> and choose 1.12 float precision.

You will have to choose all the 4 bytes mentioned above for each UV.
For example:

   

And see what is the "Float" value on the data inspector:

   

below I selected the left UV for the Capital "A", and the value is 0.833, which is 83.3% percent from the left side of the image .

Be sure that you change the letter dimensions and spacing so it will fit your new letter.
Use the base converter in order to convert your new value back to hex, and replace the old value.
You can use Photoshop (press on F8) in order to view the width and height of the letter.
*the height and width values should be the exact frame of the letter from right, left, top, bottom.


Finding the correct UV'S coordinates with Photoshop
in order to change the UV'S you will have to know what is your new UV'S.
Open your font image and select the start of the image from the left, until the start of the letter.

   

As you can see the W value is 30.3% from the left, which means that the left UV Value is 0.303
use the base converter (Intel,Float) to convert 0.303 back to hex, and then change the value with the hex editor.

   

Do the same for top, right, and bottom.

NOTICE:
for left and right use the W Value (horizontal)
for top and bottom use the H (vertical)

the right and bottom values are reversed. So it means that if the value is 66.0% for example, you will need to subtract it by 100. (100 66 = 34). So your new value will be 0.340.
Use The reversed values are only for right and bottom!

*VERY IMPORTANT NOTICE!
Be sure to close Diego Logic's font explorer before saving the binary file, if not, the file won't be updated!



Exporting back to call of duty
after you finish editing, export your tga file back to iwi.
Be sure there is only alpha channel, and that the compression is DX5.
Call your file, gamefonts_pc.iwi and put it in the images folder.
The font binary should be located at the your mod root/fonts, and should be declared with "font,fonts/fontame" on the mod.csv
(if the font not appearing in game, try to copy the font also to raw/fonts).

Enjoy your new font Tongue

IMPORTANT NOTES:
1. Unfortunately this is the best way changing fonts, Diego logic's tool (which is great) allows you to explorer the font, but not the change them within the tool, he said that he will might add this feature in the future so you won't need to mess with the hex editor at all.

2. the fonts files are auto generated with a special tool that was never available on the mod tools, so for right now, the best way is to change it manually. There is some existed tools on the internet which allows you to export fonts into bitmaps, but their binaries should be converted somehow to CoD ones, Unfortunately I'm not a coder (sigh) so I have no Idea how to do that.


good luck

-Tom.
Reply

#2
Oh wow I really needed this! Thanks a bunch!
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#3
Holy shiznitz, Quite a impressive tutorial, +1
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Call of Duty loser calls in SWAT team hoax on kid who beat him RaZ 3 4,079 04-24-2014, 19:31
Last Post: Casper
  [News] Call of Duty: Ghosts Pozzuh 59 41,901 11-05-2013, 16:05
Last Post: RaZ
  Call of Duty MW3 Help tugay12 4 5,628 08-21-2013, 00:31
Last Post: hillbilly
  A question about the Call of Duty Black Ops king_dom 1 3,707 07-08-2013, 05:26
Last Post: DidUknowiPwn
  [News] Call Of Duty: Ghosts - New Engine Video Tomsen1410 7 5,808 06-10-2013, 20:24
Last Post: Pozzuh
  Call of Duty 4 Modern Warfare topic? Erik The Born 1 3,554 06-07-2013, 17:41
Last Post: Pozzuh
  [News] Call of Duty: Online Stream DidUknowiPwn 10 7,963 05-26-2013, 11:54
Last Post: Yamato
  [Release] Export models from Call Of Duty : Black Ops JariZ 26 34,101 05-16-2013, 17:20
Last Post: mosayebg
Wink [News] Call of Duty Online (CN) Enters BravoTest (client is avaliable for download kjkszpj 17 11,376 05-06-2013, 02:18
Last Post: logitechnoob
  [News] Call of Duty: Ghosts DidUknowiPwn 19 10,308 05-02-2013, 06:50
Last Post: Pozzuh

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.