Page 1 of 6
[HUD] Font Facelift
Posted: 2017-06-17 02:20
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:
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/
Re: [HUD] Font Facelift
Posted: 2017-06-17 04:12
by Kovanaama
Good work! Much better quality.
Re: [HUD] Font Facelift
Posted: 2017-06-17 07:20
by Arab
Great initiative!

Much easier on the eyes.
Re: [HUD] Font Facelift
Posted: 2017-06-17 08:05
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.
Re: [HUD] Font Facelift
Posted: 2017-06-17 09:33
by sweedensniiperr
can we get some not zoomed in comparisons?
Re: [HUD] Font Facelift
Posted: 2017-06-17 09:41
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
Keep up the good work!

Posted: 2017-06-17 10:00
by Mineral
Looks awesome
Posted: 2017-06-17 11:34
by AfterDune
Yep, awesome. Continue pls

Re: [HUD] Font Facelift
Posted: 2017-06-17 12:54
by FlyingR
Well done! Very satisfying to see this!

Re: [HUD] Font Facelift
Posted: 2017-06-17 14:08
by TBob
Now with an updated map font
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
Keep up the good work!
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
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.
Re: [HUD] Font Facelift
Posted: 2017-06-17 15:40
by Rhino
Sounds good, and I was referring to the actual texture files rather than screenshots btw

Re: [HUD] Font Facelift
Posted: 2017-06-17 16:22
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
Could probably cut it down to 256x128 with some tweaking
Re: [HUD] Font Facelift
Posted: 2017-06-17 17:41
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?
Re: [HUD] Font Facelift
Posted: 2017-06-17 18:01
by Rhino
Nice ye, could even do 512x64? or 1024x32? same amount of pixels but might save a bit of space

Re: [HUD] Font Facelift
Posted: 2017-06-17 18:18
by Mats391
Why does there need to be so much spacing between characters?
Re: [HUD] Font Facelift
Posted: 2017-06-17 22:22
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
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.
Posted: 2017-06-17 22:27
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

Re: [HUD] Font Facelift
Posted: 2017-06-17 22:37
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.
Re: [HUD] Font Facelift
Posted: 2017-06-17 23:52
by Vista
Sounds amazing man, good job. Could you also be able to modify (higher res) vehicle UI? Like a helicopter indicator for example?
Re: [HUD] Font Facelift
Posted: 2017-06-18 00:44
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:
Based off of this:
But I think that's a topic for another thread