[HUD] Font Facelift

Making or wanting help making your own asset? Check in here
TBob
Posts: 75
Joined: 2013-07-10 01:18

[HUD] Font Facelift

Post by TBob »

I thought I'd show something I've been working on for a little while.

For a long time we've had to deal with blurry text in the BF2 engine when running at more modern resolutions, but that can be a thing of the past.

Inspired after seeing the BF2 HDUI mod, I took a look at what they had and the method they used but found it somewhat lacking.

After fiddling around with BMFont source code I came up with a method to generate nice looking fonts that display at double the normal resolution.

These are some of the results, screenshots are all taken at 1440p:

Image

Image

Image Image


There is of course a slight bump to memory usage Going through the font files I found that there seem to be a number of fonts that are essentially duplicates, for example scoreboardfont_8, squadcreationfont_6, and vehiclehudfont_6. Its possible that the UI elements could be updated to reduce the number of duplicates.

Without removing duplicates the current total size increase for all global and English fonts replaced is about 1.5 MB

This is now implemented by default, but I'll leave this download up (Updated 2018-02-17)
https://drive.google.com/file/d/0B-YPitM95ZbTZjF0SWhoNUhtb00/
Last edited by TBob on 2018-03-01 05:29, edited 13 times in total.
Kovanaama
Posts: 250
Joined: 2011-09-07 15:04

Re: [HUD] Font Facelift

Post by Kovanaama »

Good work! Much better quality.

FDF Looking for Modellers, Mappers, Textureartists and Exporters! #fdfpr @ QuakeNet orPM Hulabi
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: [HUD] Font Facelift

Post by Arab »

Great initiative! :razz: Much easier on the eyes.
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [HUD] Font Facelift

Post by Mats391 »

The font set up is mostly left over from BF2 with only small adjustments. A facelift would really be appreciated.
Making more parts use the same fonts, should work fine as well. Just need to edit the menu files a bit.
Image

Mineral: TIL that Wire-guided missiles actually use wire
sweedensniiperr
Posts: 2784
Joined: 2009-09-18 10:27

Re: [HUD] Font Facelift

Post by sweedensniiperr »

can we get some not zoomed in comparisons?
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [HUD] Font Facelift

Post by Rhino »

Nice work! Can you post pictures of the old and new files at 100% rez so we can compare? Would also be good to know how much of a memory increase there is from the old, ideally including the reductions of removing duplicates :D

Keep up the good work! :D
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Post by Mineral »

Looks awesome
Image
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Post by AfterDune »

Yep, awesome. Continue pls ;)
Image
FlyingR
Posts: 311
Joined: 2014-08-05 22:42

Re: [HUD] Font Facelift

Post by FlyingR »

Well done! Very satisfying to see this! :D
TBob
Posts: 75
Joined: 2013-07-10 01:18

Re: [HUD] Font Facelift

Post by TBob »

Now with an updated map font

Image
sweedensniiperr wrote:can we get some not zoomed in comparisons?
[R-DEV]Rhino wrote:Nice work! Can you post pictures of the old and new files at 100% rez so we can compare? Would also be good to know how much of a memory increase there is from the old, ideally including the reductions of removing duplicates :D

Keep up the good work! :D

To be clear, none of my screenshots have been resized - that's just how things look at my native resolution of 1440p (this might give you a better idea of why I would be doing this)

I didn't make direct comparisons but this is how it looks natively at 720p and 1080p

Image

Image

Since this is doubling the resolution 4x texture size is a given, though due to the less efficient glyph packing I have to use to get things to work properly somewhere in the range of 8x is more likely.

I haven't nailed down the exact number of true duplicates but I estimate this would equate to around 4Mb additional decompressed texture size. For comparison the Chinese localization uses something like 20Mb more than English.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [HUD] Font Facelift

Post by Rhino »

Sounds good, and I was referring to the actual texture files rather than screenshots btw :)
Image
TBob
Posts: 75
Joined: 2013-07-10 01:18

Re: [HUD] Font Facelift

Post by TBob »

[R-DEV]Rhino wrote:Sounds good, and I was referring to the actual texture files rather than screenshots btw :)
Ah
Here is an example for the capture point font

Image

Image

Could probably cut it down to 256x128 with some tweaking
LordHenryWotton
Posts: 7
Joined: 2016-03-04 09:43

Re: [HUD] Font Facelift

Post by LordHenryWotton »

What a coincidence, I actually remarked just yesterday whilst playing PR with my friend that the font should be updated as it's barely readable on a modern screen. Does your font also change the way chat looks? And what about console? Can we try using your font ourselves?
"Are you dead-dead?"
"No, I'm wounded."
"Am I standing on you?"
"Yes."
"The epipens don't work!"
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [HUD] Font Facelift

Post by Rhino »

Nice ye, could even do 512x64? or 1024x32? same amount of pixels but might save a bit of space :)
Image
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: [HUD] Font Facelift

Post by Mats391 »

Why does there need to be so much spacing between characters?
Image

Mineral: TIL that Wire-guided missiles actually use wire
TBob
Posts: 75
Joined: 2013-07-10 01:18

Re: [HUD] Font Facelift

Post by TBob »

[R-DEV]Rhino wrote:Nice ye, could even do 512x64? or 1024x32? same amount of pixels but might save a bit of space :)
That could work better in some cases but for this particular one you would end up using more space
[R-DEV]Mats391 wrote:Why does there need to be so much spacing between characters?
There is some excess padding but way the scaling works you have to use uniform cell heights otherwise you can end up with characters having the wrong vertical alignment.

There is also some slightly weird behavior in the sorting due to my modifications. Someone with better coding knowledge than could probably fix this.

Here's what it looks like with zero extra padding

Image

Image

It just barely overflows from 256x128 due to the weird offset where the 7 and K lines start and the gap at the bottom. The single pixel gaps are intentional.

You also might be able to overlap some of the empty parts of the glyph cells to save a bit of space but I don't have an automated way of doing that.
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Post by AncientMan »

Remove some characters that are not used to save space :)

You could also look into SDF fonts. Requires modifying the font rendering shaders. Much more complicated of course, but can get some really nice looking fonts with that that scale to any resolution :)
Image
TBob
Posts: 75
Joined: 2013-07-10 01:18

Re: [HUD] Font Facelift

Post by TBob »

A wild AncientMan appears!

Yeah that's an option, I was just trying to include all the characters from the original (I believe this is one of the ones you made).

I wouldn't even know where to begin to get distance field fonts working in BF2.
Vista
Posts: 1282
Joined: 2011-04-30 10:36

Re: [HUD] Font Facelift

Post by Vista »

Sounds amazing man, good job. Could you also be able to modify (higher res) vehicle UI? Like a helicopter indicator for example?
TBob
Posts: 75
Joined: 2013-07-10 01:18

Re: [HUD] Font Facelift

Post by TBob »

LordHenryWotton wrote:What a coincidence, I actually remarked just yesterday whilst playing PR with my friend that the font should be updated as it's barely readable on a modern screen. Does your font also change the way chat looks? And what about console? Can we try using your font ourselves?
I haven't done the chat font yet. Console I was thinking of leaving as-is.

This is my current testing set of fonts, still several things that haven't been redone. There's also incomplete character sets and excessive texture usage
https://drive.google.com/file/d/0B-YPit ... sp=sharing
Make sure you make a backup and you'll need to run in offline mode or rename your mods/pr directory of course
Vista wrote:Sounds amazing man, good job. Could you also be able to modify (higher res) vehicle UI? Like a helicopter indicator for example?
Updating the the HUD elements just requires someone to redraw them at a higher resolution. Just remember every bit you add is more memory usage. I had actually started messing with making a new LAV crosshair:

Image

Based off of this:

Image

But I think that's a topic for another thread
Post Reply

Return to “PR:BF2 Community Modding”