Monday Jan 30, 2012

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.
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
« July 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
31
  
       
Today