JDK-6288260 : RFE: Provide a means to get desktop font smoothing (text antialiasing) settings.
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-06-20
  • Updated: 2017-05-16
  • Resolved: 2005-08-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b47Fixed
Related Reports
Duplicate :  
Relates :  
Description
In mustang we have now implemented support for text antialiasing modes
such as LCD-optimised text.
Swing has been updated to pick up desktop font smoothing settings and
so can specify the appropriate text antialiasing mode on a Graphics.

However this is internal to Swing and isn't exposed to applications.
So an application writing a custom Swing component, a custom Look and
Feel, or otherwise wants to draw text using the same desktop settings
is unable to discover those settings.

We need to provide a simple way for an application to obtain the
necessary settings that can be directly applied.

Also those desktop settings can change, so there needs to be a
mechanism to listen for changes in the property.
###@###.### 2005-06-20 20:18:52 GMT

Comments
EVALUATION Leverage the existing Toolkit.getDesktopProperty() API which can use String key to return an Object, which in this case will be a Map of RenderingHints or null (no properties available). Toolkit tk = Toolkit.getDefaultToolkit(); Map map = (Map)(tk.getDesktopProperty("awt.font.desktophints")); if (map != null) { graphics2D.addRenderingHints(map); } Changes in the desktop property can be obtained via a PropertyChangeListener. tk.addPropertyChangeListener("awt.font.desktophints", pcl); ###@###.### 2005-06-20 20:18:52 GMT
20-06-2005