Page 1 of 2

Text rendering improvements

Posted: Wed May 18, 2011 7:41 am
by robn
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: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.

RE: Text rendering improvements

Posted: Wed May 18, 2011 10:21 am
by Guest
This is excellent - far more easier to read than the current font. :D 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.

RE: Text rendering improvements

Posted: Wed May 18, 2011 5:51 pm
by robn

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

RE: Text rendering improvements

Posted: Wed May 18, 2011 8:06 pm
by s2odan

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

RE: Text rendering improvements

Posted: Wed May 18, 2011 8:12 pm
by robn

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 :)

RE: Text rendering improvements

Posted: Wed May 18, 2011 8:56 pm
by s2odan
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 ;)

RE: Text rendering improvements

Posted: Wed May 18, 2011 10:14 pm
by robn
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 :)

RE: Text rendering improvements

Posted: Wed May 18, 2011 10:42 pm
by ollobrain
if u want to go a bit further how about 3 or 4 fonts and allow the player to choose which one they want

RE: Text rendering improvements

Posted: Wed May 18, 2011 10:50 pm
by robn
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.

RE: Text rendering improvements

Posted: Thu May 19, 2011 12:08 am
by ollobrain
oh ok so a moddible font selection , without a ingame option choice i guess its a good fallback

RE: Text rendering improvements

Posted: Thu May 19, 2011 4:40 am
by robn
Almost there: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.

RE: Text rendering improvements

Posted: Thu May 19, 2011 5:00 am
by ollobrain
i like the new font better than the existing one

RE: Text rendering improvements

Posted: Thu May 19, 2011 7:50 am
by Cavefish

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

RE: Text rendering improvements

Posted: Thu May 19, 2011 7:52 am
by Guest
Nice font, will it be included in the next nightly build?

RE: Text rendering improvements

Posted: Thu May 19, 2011 7:54 am
by robn

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 :)

RE: Text rendering improvements

Posted: Thu May 19, 2011 7:54 am
by robn

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.

RE: Text rendering improvements

Posted: Thu May 19, 2011 1:17 pm
by s2odan

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 :D

RE: Text rendering improvements

Posted: Sat May 21, 2011 2:00 am
by robn
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

RE: Text rendering improvements

Posted: Thu May 26, 2011 3:44 pm
by Coolhand
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

RE: Text rendering improvements

Posted: Thu May 26, 2011 4:46 pm
by robn

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.