JDK-4828102 : Need API to get/set TextAttribute on Graphics2D
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.1,1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2003-03-06
  • Updated: 2005-08-25
  • Resolved: 2005-08-25
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
This RFE is intended to provide the Graphics2D class with a set of API to get/set text attributes defined in java.awt.font.TextAttribute.  Currently, there is no way to specify those attributes when the application calls text drawing methods on Graphics2D, such as drawString method, even though it can handle complex text.

The API would simply maps the functionality currently implemented in the Font class and the TextLayout class so that the application can expect the same result.  In case that the application creates its own Font or TextLayout instance, and sets conflicting text attributes in Graphics2D, those attributes in Font or TextAttribute take precedence.

This API is originally required to address the numeric shaping feature in Swing components (RFE 4337267) and the default text run direction problem (in drawString, bug 4701238).

###@###.### 2003-03-05

Comments
EVALUATION This is no longer needed as it has been addressed by making a Font accept all text attributes. This was addressed under bug ID 4296952. So it is not necessary to set them on the graphics, set them as part of the Font and text rendering will behave properly
25-08-2005