Notifications
Clear all

Text rendering improvements


robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  

I've spent the last few days studying the dark art of text rendering and while I still have a lot to do to get to where I want it to be, I've come far enough to share a few screenshots:

4kYpS.png

KEgyO.png

kSbOt.png

895PO.png

7r92z.png

The font itself is Titillium. So far I've added support for kerning and subpixel positioning, and I've turned off the automatic justification, so things are reading much much easier. There's still some work to do on character spacing and vertical hinting.


Quote
 Anonymous
Joined: 54 years ago
Posts: 0
 

This is excellent - far more easier to read than the current font. 😀

You are right though, the spacing doesn't seem to be quite right though (I'm spoilt with Mac fonts), and I can't really put my finger on it, except to say that it just isn't right.


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
Philbywhizz wrote:
You are right though, the spacing doesn't seem to be quite right though (I'm spoilt with Mac fonts), and I can't really put my finger on it, except to say that it just isn't right.

The conventional wisdom is that Mac fonts look blurry at small sizes but are utterly glorious on large, high DPI displays, while Windows looks fantastic at low DPI but can't scale up worth a damn. Meanwhile, Linux looks like shit because nobody knows how to configure fontconfig 😆

The problem mostly seems to mostly come from the hinting being done on integer boundaries. What I want to try is transforming the raw glyph to its subpixel position before its hinted, which might give better results.

Fyi, I've studied this a lot to get ideas: http://www.antigrain.com/research/font_rasterization/ . I can't use the algorithms as-is because they're deliberately designed for RGB sub-pixel rendering, which is only going to work on LCD displays. I don't want to limit us to that since I know a couple of people are using an old CRT and there's rumours of iPad ports which RGB sub-pixels aren't going to work. Either way though, take a look at the screenshots - these are unmodified classic TrueType fonts like Arial and Times New Roman rendered with an unmodified FreeType. Linux is capable of this right now, in theory. Its bitterly disappointing that nobody has bothered to do the work.


ReplyQuote
s2odan
(@s2odan)
Captain Registered
Joined: 15 years ago
Posts: 1212
 
Quote:
while Windows looks fantastic at low DPI but can't scale up worth a damn.

I've always found the fonts look pinsharp with win7 on my 2560x1600 display. But thats probably the 'Clear-type' setting which is supposed to make things look nice and pretty.

Pioneer has also always looked rather crisp and sweet at that resolution, and I have never really noticed any problems with the font.

Don't get me wrong I'm not against the changes, In fact I would welcome them with open arms if you think it will actually improve things. 🙂


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
s2odan wrote:
Quote:
while Windows looks fantastic at low DPI but can't scale up worth a damn.

I've always found the fonts look pinsharp with win7 on my 2560x1600 display. But thats probably the 'Clear-type' setting which is supposed to make things look nice and pretty.

Its still running at 96 DPI though. Microsoft have spent a lot of time optimising for their specific cases and the fonts they ship, but haven't done as well for the general case, so fonts designed for print generally look lousy whereas they look much better on Mac. That's not a criticism; rather just being aware of the different philosophies at Microsoft and Apple.

Quote:
Pioneer has also always looked rather crisp and sweet at that resolution, and I have never really noticed any problems with the font.

Pioneer (currently) has its fonts at 12 virtual pixels (on the 800x600 virtual display). Appropriate scaling is fed to FreeType to make sure the the fonts aren't bitmap scaled but rather are scaled by the renderer. So they look good at large sizes, but struggle at a native 800x600 (which is where I play so I can still see the debugger on the small laptop screen).

My goal is to make it look decent at any size.

Quote:
Don't get me wrong I'm not against the changes, In fact I would welcome them with open arms if you think it will actually improve things. 🙂

You probably won't notice the difference on your massive screen. I will though 🙂


ReplyQuote
s2odan
(@s2odan)
Captain Registered
Joined: 15 years ago
Posts: 1212
 

That article is pretty interesting and explains it all rather nicely. Your right windows scaling is wrong 🙂 Although it has improved a bit since XP, probably due to other trickery. I remember with XP using this large display, countless programs would have text cut-off and were un-usable when using the built-in scaler @144DPI... So my understanding from that article is that it is down to Microsofts poor scaling technique.... right? Windows 7 seems to be much better with the scaling, not perfect but it at least works this time round 🙂

I don't get what you mean by saying its stuck at 96 DPI..? As I can select some pretty high DPIs using the windows scaler, not that they would look that great over 144 DPI but the option is there...

Surely if the fonts are rasterised then any DPI > 96 would be possible...?

I know I may sound like it, but I am not a windows fan... its just a necesary evil in my world and if I could I would have jumped shop to Linux many years ago 😉


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  

I'm not really saying anything - I just barely understand this myself. And you don't have to justify to me why you use the software you do - whatever works for you 🙂 I don't use Linux for any philosophical reason. The first PC I owned was a 486 but I didn't get it until 1998, and it couldn't run any semi-modern Windows very well, so I shopped for alternatives and found Linux. As a result I've spent the last decade learning Linux without much significant exposure to Windows. Sometimes the chips just fall that way 🙂


ReplyQuote
ollobrain
(@ollobrain)
Lieutenant Registered
Joined: 13 years ago
Posts: 564
 

if u want to go a bit further how about 3 or 4 fonts and allow the player to choose which one they want


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  

My intention is that you fonts won't be selectable in-game, but you will be able to replace them with whatever you want. There will be font configuration files that will let you tweak the renderer without requiring a recompile, so you can drop in the font of your choice without being tied to the specific adjustments made for the stock fonts.


ReplyQuote
ollobrain
(@ollobrain)
Lieutenant Registered
Joined: 13 years ago
Posts: 564
 

oh ok so a moddible font selection , without a ingame option choice i guess its a good fallback


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  

Almost there:

qfK6M.png

Mlah5.png

That's a bruteforced -1px character spacing adjustment, and demonstrates why I want a per-font config file - I don't want to hardcode it because it feels like its more to do with the font itself than the renderer. This way you get lots of control to make your font appear just the way you like it.


ReplyQuote
ollobrain
(@ollobrain)
Lieutenant Registered
Joined: 13 years ago
Posts: 564
 

i like the new font better than the existing one


ReplyQuote
Cavefish
(@cavefish)
Petty Officer Registered
Joined: 13 years ago
Posts: 27
 
robn wrote:
Almost there:

That's a bruteforced -1px character spacing adjustment, and demonstrates why I want a per-font config file

Maybe rather a "style sheet" for the entire gui, so you can define the font, text spacing, gui tint and such


ReplyQuote
 Anonymous
Joined: 54 years ago
Posts: 0
 

Nice font, will it be included in the next nightly build?


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
Cavefish wrote:
Maybe rather a "style sheet" for the entire gui, so you can define the font, text spacing, gui tint and such

I'd like to do something like that, but we're not there yet. There is a theming engine inside Pioneer but its very rudimentary and not used consistently yet. So its coming 🙂


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
Gudadantza wrote:
Nice font, will it be included in the next nightly build?

Not yet. Early next week I hope. If you're able to do your own builds though you're welcome to try my text-rendering branch.


ReplyQuote
s2odan
(@s2odan)
Captain Registered
Joined: 15 years ago
Posts: 1212
 
Quote:
The first PC I owned was a 486 but I didn't get it until 1998, and it couldn't run any semi-modern Windows very well, so I shopped for alternatives and found Linux. As a result I've spent the last decade learning Linux without much significant exposure to Windows. Sometimes the chips just fall that way 🙂

98!! You newb hehe. You've come a long way in a pretty short time....

I *barely* remember having a 286 back in the late 80s with windows 2.0... I was probably all of 6 years old then hehe. Started(Attempted) building/modding them around at around 10, I still remember breaking my PC on my first attempt to install a CD drive 😀


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  

Fyi, this mess just hit the master branch and so will be in tonight's dev build.

The very simple font config looks like this: GuiFont.ini


ReplyQuote
Coolhand
(@coolhand)
Master Chief Registered
Joined: 13 years ago
Posts: 112
 

I find this typeface really suits the game well, but the spacing adjustment i think is making the letters a little close together.

http://www.fontsquirrel.com/fonts/Orbitron


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
Coolhand wrote:
I find this typeface really suits the game well, but the spacing adjustment i think is making the letters a little close together.

http://www.fontsquirrel.com/fonts/Orbitron

And that's exactly what the font config is for. Adjust the AdvanceXAdjustment parameter and you should be able to get it looking good.


ReplyQuote
Geraldine
(@geraldine)
Rear Admiral Registered
Joined: 7 years ago
Posts: 3446
 

I noticed that there are two El Cancri stars in the system map in your picture robn. How did I miss that! 😳

As for the fonts, yes a nice improvement and easier to read than the old ones 🙂


ReplyQuote
robn
 robn
(@robn)
Captain Registered
Joined: 13 years ago
Posts: 1035
Topic starter  
Geraldine wrote:
I noticed that there are two El Cancri stars in the system map in your picture robn. How did I miss that! 😳

Yes, so did I, and it amused me that I hadn't seen it sooner. Its already fixed in dev.


ReplyQuote