LCD Text support in JavaFX 2.1 Developer Preview

Content provided by Phil Race

LCD sub-pixel text has become a must-have for many Windows desktop users, who have become accustomed to its superior legibility and less blocky appearance at smaller point sizes over hinted black and white text, and being sharper than grey scale anti-aliased text at the same size.

Java SE has supported LCD subpixel text on AWT heavyweights and also on Swing components using Java 2D for many years. However up until now, JavaFX has supported only more Mac OS X-like grey scale smoothed text.

For the JavaFX 2.1 release we've added the ability to use Windows-style LCD sub-pixel rendering. All the JavaFX UI controls will be LCD-text enabled by default on Windows, as will "WebView", the Webkit-based node for rendering Web content.

Applications can also opt-in to use LCD text on the low-level scenegraph "Text" node by a new API :
Text.setFontSmoothingType(FontSmoothingType.LCD));

Here is a fairly representative example of "before" and "after" LCD text on a Windows system:

1. WebView text rendering without LCD text support


2. WebView text rendering with CD text support


Note: make sure both images at being viewed at proper size (1020x700px). Depending on your browser DPI setting, your browser may scale images to fit, and the second image nay bnot display like the original.
Comments:

This looks so much better.

Thank you!

Posted by Nick on February 10, 2012 at 08:28 AM PST #

I'm glad this will be optional, because I personally detest the red and green fringes from these more legible fonts.

Posted by John Hendrikx on February 13, 2012 at 01:14 AM PST #

This is a really great feature. Thanks

Posted by Shiv Kumar Ganesh on February 13, 2012 at 04:22 AM PST #

What about sub-pixel rendering in OSX? Just as ugly and clashing with all other apps as it was on Windows.

Posted by guest on January 30, 2013 at 11:40 AM PST #

> What about sub-pixel rendering in OSX? Just as ugly
> and clashing with all other apps as it was on Windows.

I presume you mean the *lack* of LCD sub-pixel rendering is clashing ?
We did initially enable LCD on OS X, but it didn't blend as well on the OS X desktop
as it did on Windows. Also greyscale rendering is quite common on OS X.
So on OS X we chose for now to stay with grey scale rendering until we had LCD rendering that was compatible with OS X.

Also note that iOS doesn't support LCD text *at all*.

There is a system property to turn it on : -Dprism.lcdtext=true

Posted by Phil Race on January 30, 2013 at 01:49 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog is maintained by Nicolas Lorain, Java Client Product Manager. The views expressed on this blog are my own & do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today