nikobarli
Topic Author
Posts: 178
Joined: 26 Apr 2017, 06:23

Crisper font rendering

21 Sep 2017, 08:06

Hi,

Is there any way to make font rendering in NoesisGUI crisper ?
Below is a screenshot comparing NoesisGUI on the left with WPF on the right. The font size is 9pt.
(Please download the attach file and view it directly with an image viewer to see the difference better).
FontRendering.PNG
FontRendering.PNG (4.2 KiB) Viewed 2174 times
It might be difficult to see, but the characters on the left side appears to have darkened parts on its strokes.
Also the intensity is darker compared to WPF.

Below is the same image after zoomed.
FontRenderingZoomed.PNG
I tried to minimize/maximize MSAA setting and also Tesselation Quality without success.

If you have any suggestion, please let me know.
 
User avatar
ai_enabled
Posts: 221
Joined: 18 Jul 2013, 05:28
Contact:

Re: Crisper font rendering

21 Sep 2017, 11:19

Hi,

In NoesisGUI 1.2 the text rendering quality was even better than WPF with ClearType. Alas, we will never get it back.

The NoesisGUI team dropped the colored subpixel anti-aliasing/hinting text rendering (aka ClearType; they didn't use actual Microsoft ClearType API of course) for multiple reasons in NoesisGUI 2.0. You can notice this on the zoomed images you've posted. NoesisGUI 2.0 has a compromise solution - the grayscale subpixel anti-aliasing (and FYI they even wanted to drop anti-aliasing and hinting completely. Only when I tried early 2.0 beta and mentioned that it makes the text unreadable on standard PC screens (96 DPI), they've quickly implemented the grayscale subpixel anti-aliasing).

The reasoning (other than the technical challenge with a particular rendering architecture and serious rendering overhead) is (I believe, as I can't say for the team) the same as Microsoft had when they decided to drop colored anti-aliasing in UWP (it would be nice if you make a screenshot to compare the same text NoesisGUI vs WPF vs UWP).
Mostly, it's because UWP targeting devices with HiDPI (modern mobile devices and laptops). Another issue is that when you rotate a display, the RGBRGBRGB subpixel layout becomes RRRGGGBBB, so it's not possible to apply colored subpixel anti-aliasing with this screen orientation and for the mobile devices ClearType doesn't work in half cases (I remember having Pocket PC with Windows Mobile 2003 a decade ago with the blurred text in landscape mode - it seems to me it was also using ClearType in that case).
Another issue is that ClearType text cannot be smoothly animated as it obviously relies on the heavy hinting (forcing font into the pixel grid) and colored subpixel rasterization, which works fine only on discrete font sizes.

Anyway, they're not much to regret about, as the low-DPI displays age is coming to its end. Mobile devices are mostly HiDPI (and when they're not, they don't have perfect text rendering either so NoesisGUI with the grayscale subpixel anti-aliasing looks good on them), most modern laptops are HiDPI, new TV sets are 4K and PC monitors are slowly migrating to 4K/HiDPI. And all Apple product are all HiDPI/"Retina" except outdated MacBook Air (from 2015, which will be updated or, most likely, dropped completely soon).

Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
nikobarli
Topic Author
Posts: 178
Joined: 26 Apr 2017, 06:23

Re: Crisper font rendering

22 Sep 2017, 04:23

Hi, thanks for the information ! I now understand some historical reasons behind this behavior.

Here is a comparison of Noesis - UWP - WPF. It confirms what you said that UWP also drop colored anti-aliasing. Somehow, they render with higher intensity (I apply the same #FFFFFFFF as the font color).
Noesis-UWP-WPF.PNG
Anyway, they're not much to regret about, as the low-DPI displays age is coming to its end
Unfortunately, we are in a slow moving health-care industry ... low-DPI displays will be there for another 10 years at least...
 
User avatar
ai_enabled
Posts: 221
Joined: 18 Jul 2013, 05:28
Contact:

Re: Crisper font rendering

22 Sep 2017, 09:47

nikobarli, thanks for posting the comparison screenshot with UWP! It seems it's much more important for hieroglyphic text to have strong hinting. We didn't notice so big difference in our game even in comparison to WPF ClearType, even with very small font size.
I recall e-mail conversation with jsantos about NoesisGUI 1.3 beta 3 (which become 2.0.0 on release) that they want to make hinting configurable as in some cases hinted rendering looks artificial as it distorts original fonts (Apple vs Microsoft approach to text rendering). We don't follow up on it so I don't know whether the required API was implemented and what the hinting mode NoesisGUI is using by default now (if there were any changes other than logged in the Changelog).
From the Changelog (NoesisGUI 2.0.0 beta 3):
Version 2.0.0b1
New text rendering algorithm with enhanced subpixel positioning. Hinting and ClearType no longer used.

Version 2.0.0b3
Static text rendering quality improved. Vertical hinting is active by default right now.
So let's wait for NoesisGUI team to clarify the issue.
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Crisper font rendering

22 Sep 2017, 14:14

Thanks for the great clarifications, ai_enabled. Effectively we decided to drop colored subpixel anti-aliasing due to the following reasons:
  • Firstly, we wanted to have an unified rendering architecture. ClearType is not compatible when the text moves or rotates.
  • ClearType is also not compatible with certain device screens and orientations
  • It is also not compatible when doing render target composition (when using opacity)
We also wanted to drop hinting, but as ai_enabled we decided to keep it (only vertical hinting). Right now, there is no way to disable it, but we have plans to have a setting to fully disable hinting because in HDPI devices the quality is a bit better, glyphs outlines are a bit more natural (rounded) and they translate and zoom more smoothly.

There is another important factor: linear alpha blending with gamma correction, that's probably the explanation to the differences you are observing between UWP and Noesis. To enable gamma corrected blending you need to activate linear rendering in Noesis. You also need proper bytecode hinting support in the font (many .OTF fonts support it, we did our internal tests using this one). If that bytecode is not present the font will be displayed a bit darker probably (on Low DPI devices mainly).
 
nikobarli
Topic Author
Posts: 178
Joined: 26 Apr 2017, 06:23

Re: Crisper font rendering

25 Sep 2017, 02:58

I tried enabling the sRGB flag and yes, the text is rendered brighter.
However, for larger size of text, it also makes the text bolder.

Below is the capture (left side is Noesis with sRGB, right is WPF). Upper text is 9pt font. Lower text is 12pt font.
sRGB.PNG
From performance point of view, is there any performance penalty if we enabled sRGB ?
 
User avatar
jsantos
Site Admin
Posts: 2900
Joined: 20 Jan 2012, 17:18
Contact:

Re: Crisper font rendering

26 Sep 2017, 21:06

From performance point of view, is there any performance penalty if we enabled sRGB ?
Performance is about the same, if not the same. Although it is important to note that the render is a bit different when sRGB is enabled, it is more mathematically correct but different from the output you get from WPF or Blend. You may like it better or not...

Who is online

Users browsing this forum: No registered users and 1 guest