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

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

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

Postby Cerfon Rournes » Tue Dec 27, 2011 3:08 pm

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.

Jedi Admin
User avatar
Posts: 11025
Joined: Wed Sep 07, 2005 11:42 pm
Location: Indiana
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set

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

Postby Teancum » Tue Dec 27, 2011 3:48 pm

Nice! :thumbs:

By the way, I love that you're taking a stab at redesigning the HUD.

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

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

Postby Cerfon Rournes » Tue Dec 27, 2011 3:57 pm

Thanks Tean.
Offtopic. Here is my most recent HUD update. :)
Hidden/Spoiler:
Image

Jedi Admin
User avatar
Posts: 11025
Joined: Wed Sep 07, 2005 11:42 pm
Location: Indiana
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set

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

Postby Teancum » Tue Dec 27, 2011 4:03 pm

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:

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

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

Postby Cerfon Rournes » Tue Dec 27, 2011 4:05 pm

Thanks for the comment and tip. :)

Master Bounty Hunter
User avatar
Posts: 1602
Joined: Mon Jul 16, 2007 1:30 pm
Location: Las Vegas
Projects :: Battlefront Chronicles

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

Postby Eggman » Tue Dec 27, 2011 4:09 pm

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

Resistance Leader
Online
User avatar
Posts: 5204
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Zero Munge + TCW
Games I'm Playing :: The Forest
xbox live or psn: Marth8880

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

Postby Marth8880 » Tue Dec 27, 2011 4:12 pm

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...

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

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

Postby Cerfon Rournes » Tue Dec 27, 2011 4:13 pm

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?

Banned
User avatar
Posts: 84
Joined: Mon Sep 19, 2011 5:41 pm
Location: In A Nearby Solar System
Projects :: I move fast... Lightning fast...
Games I'm Playing :: Hmm... I wonder...

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

Postby DarthXeon » Thu Mar 01, 2012 7:33 pm

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

Resistance Leader
Online
User avatar
Posts: 5204
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Zero Munge + TCW
Games I'm Playing :: The Forest
xbox live or psn: Marth8880

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

Postby Marth8880 » Thu Mar 01, 2012 8:48 pm

That's a replica of the TFU HUD, not the Saint's Row HUD.

Master of the Force
User avatar
Posts: 4761
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

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

Postby Anakin » Fri Jan 03, 2014 10:27 am

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

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

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

Postby Cerfon Rournes » Fri Jan 03, 2014 11:33 am

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

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 0 guests