How to get a custom font working. [Tutorial] (FAQ)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

How to get a custom font working. [Tutorial] (FAQ)

Post by Cerfon Rournes »

The subject says it all. In this I will show you how to get your custom font working and ingame for SWBF2.

1. Go to BF2_ModTools/ToolsFL/bin/Fontedit.exe.

2. Open the program.

3. Click "Font", then "Capture". From there, select your font options.(Press "Show more fonts" to see all of the pre-installed windows fonts. In this way, you can install custom fonts and load them from the same "Show more fonts" window.) You should make sure you take the stock sizes as references.* See below for size refs.

4. After you have selected your options, press "Ok." You will now see the screen load all of the letters, numbers, and symbols. This may take a while depending on how big the font was.

5. Hit file, save. Save your new font in: data_***/Common/fonts. Make sure you save it as a Bitmap Font File(.FFF). Example: Newepicfont.FFF

6. Close the font program. Go to the folder where you saved the font to. (Should be data_***/Common/fonts). Copy one of the .fff.option files that was relative to your font's size and rename it to yours.*See below for size refs.

7. Now your font is ready for using! To load it for any use, go to data_***/common/core.req.
Add this line.

Code: Select all

REQN
{
"font"
"newfontthatyoujustmade"
"ifyoumadeanotheroneaddithere"
"anotherone..."
}
And so on.

8. Now, you can reference your font in certain files and scripts. For example, I loaded my custom font in the HUD files.
Example of that.
Text("player1weapon1name")
{
TextBox(0.328125, 0.000000)
TextBreak("Word")
TextFont("tfu_med")
Hidden/Spoiler:
Image
That's it! I hope that somebody finds this useful in the future. :)
*Here are a list of the stock battlefront text sizes and formats.
Hidden/Spoiler:
starwars_small = Aurabesh, regular, size = 10, antialias 1
gamefont_large = BattlefontShell, regular, size = 27, antialias 4
gamefont_medium = BattlefontShell, regular, size = 22, antialias 4
gamefont_small = BattlefontShell, regular, size = 20, antialias 4
gamefont_tiny = BattlefontShelltiny, regular, size = 17, antialias 4
This information can be found in the "readme" file, data_***/Common/fonts.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Tutorial-How to get a custom font working.

Post by Teancum »

Nice! :thumbs:

By the way, I love that you're taking a stab at redesigning the HUD.
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Tutorial-How to get a custom font working.

Post by Cerfon Rournes »

Thanks Tean.
Offtopic. Here is my most recent HUD update. :)
Hidden/Spoiler:
Image
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Tutorial-How to get a custom font working.

Post by Teancum »

If I had to critique I'd say make the reticule more translucent and move the health/stamina and map up a bit, but other than that I really like it! :thumbs:
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Tutorial-How to get a custom font working.

Post by Cerfon Rournes »

Thanks for the comment and tip. :)
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Tutorial-How to get a custom font working.

Post by Eggman »

I never even thought about changing the fonts in the game. I don't know that I would ever bother doing so, but it's cool nonetheless that you've posted a tutorial.

As for your custom HUD, it's looking better all the time! I especially like what you're trying out with the weapon display in the most recent update. My only complaint is that everything is bunched over on the left side of the screen. It isn't cluttered by any means, but it does look a little unbalanced. Then again, I'm a big fan of symmetry. :P
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Tutorial-How to get a custom font working.

Post by Marth8880 »

Argh, this still isn't working for the shell; everything still looks like random, gibberish symbols! :runaway: I'll post screenshots of that screwed up stuff soon, after I re-implement the font...
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: Tutorial-How to get a custom font working.

Post by Cerfon Rournes »

Thanks for the comment Eggman!
Here is my main ref for the HUD changes.
Hidden/Spoiler:
Image
@Marth8880: Hmm. Again, I'm not sure why that is. Did this happen with every font that you tried?
User avatar
DarthXeon
Banned
Posts: 84
Joined: Mon Sep 19, 2011 5:41 pm
Projects :: I move fast... Lightning fast...
Games I'm Playing :: Hmm... I wonder...
Location: In A Nearby Solar System

Re: Tutorial-How to get a custom font working.

Post by DarthXeon »

Cerfon Rournes wrote:Thanks Tean.
Offtopic. Here is my most recent HUD update. :)
Hidden/Spoiler:
Image
Saints Row Hud FTW
Edit: With The Weapons Yea But Not Really The Health
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: How to get a custom font working. [Tutorial] (FAQ)

Post by Marth8880 »

That's a replica of the TFU HUD, not the Saint's Row HUD.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: How to get a custom font working. [Tutorial] (FAQ)

Post by Anakin »

So after everybody told me text disable on HUD is not possible, i played a lot around and now i found a way.

The problem with this is, that i also disabled most of the menu text :D So my mod kills the text from everywhere.

Maybe someone has an idea, but first my addition for this tutorial.

Download this font

and install it like the tutorial above. You need to name the font gamefont_large, gamefont_small,... just the way the stock ones are called. Besides some letters like ö, ä, ü,.. all are removed.

I haven't found out what font is for what thing, but i'm pretty sure it should be possible to remove just the hud textes and not the menu text.
BUT this can also affect other maps. haven't test it now.

With this methode you can remove text from the hud WITHOUT a global ingame.lvl
User avatar
Cerfon Rournes
Master Bounty Hunter
Master Bounty Hunter
Posts: 1558
Joined: Thu Jul 08, 2010 5:53 pm
Projects :: WIP. I will reveal what it is later on..
Games I'm Playing :: SWBF2-SWRC
xbox live or psn: No gamertag set
Location: New York, USA
Contact:

Re: How to get a custom font working. [Tutorial] (FAQ)

Post by Cerfon Rournes »

Neat discovery Anakin! That is something that is definitely worth a look; If I get some time I'll test it out.
Post Reply