Poor font rendering..

Robert Fisher rfisher at tesis.de
Tue Mar 11 08:57:07 UTC 2014

Hi Felipe,

thanks for the detailed reply, that Firefox blog post is interesting.

I guess sub-pixel positioning is the crucial point here. If a black, 1-pixel wide vertical stroke is positioned between two pixels, you'll get a dimmer, 2-pixel wide stroke instead. 

Suppose I want to see what GDI, SWT-like text looks like in JavaFX. I should set -Djavafx.text=t2k. But looking at the picture (http://i.imgur.com/CGyckge.png) it still seems there is some additional blurring in JavaFX. Some additional sub-pixel positioning logic, perhaps?

But I concede that there has to be a compromise between positioning and 'vibrancy' for small text.


-----Ursprüngliche Nachricht-----
Von: openjfx-dev [mailto:openjfx-dev-bounces at openjdk.java.net] Im Auftrag von Felipe Heidrich
Gesendet: Montag, 10. März 2014 18:46
An: OpenJFX Mailing List
Betreff: Re: Poor font rendering..

Thank you Rob,

DirectWrite is the engine JavaFX uses to produces glyph masks (white on black), therefore JavaFX text should resemble that of DirectWrite (it is not exactly the same, as JavaFX does its own color blending and gamma correction).

We decided to use DirectWrite for JavaFX because it is the most modern native technology on Windows that we can use.
In particular, we were interested on sub pixel positioned text. GDI, for example, all glyph positioning are expressed as integer, and glyphs are (usually) aggressively hinted.

Interesting FIreFox had all the same trouble when they switched from GDI to DirectWrite.
Please read https://blog.mozilla.org/nattokirai/2011/08/11/directwrite-text-rendering-in-firefox-6/
JavaFX always uses DirectWrite natural mode rendering. We too can provided switches for GDI Classic rendering mode, cleartype level, enhanced contrast, gamma, etc.
It is all defined here

Maybe that would help ?

SWT uses GDI to render text (I know, I implemented it). 
JavaFX with -Djavafx.text=t2k uses GDI to render LCD text, SWT and JavaFX with -Djavafx.text=t2k are not same, but similar, likely again because JavaFX does its own color blending and gamma correction.


More information about the openjfx-dev mailing list