-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
None
-
generic
-
generic
Clients typically use drawString to render small, complete segments of text. This call does not fully support all the text and layout attributes. In particular it does not support the layout attributes, RUN_DIRECTION and NUMERIC_SHAPING (used in right-to-left languages), nor does it support some more familiar text attributes, e.g., underline or strikethrough. Client control of rendering using these attributes is currently available only through the TextLayout API.
It is desireable to let one framework (such as swing, or a parent component) compute and set some text attributes for a client (a child component, or a user of a swing component). It is also desireable that clients not have to change their code in order to access this functionality.
It is proposed that new state be added to Graphics2D to hold the full complement of TextAttributes. Methods will be added to let clients modify and query the attributes used for rendering. The semantics of setFont and the relationship of the font and its attributes to the graphic's attributes will be clarified.
This will allow frameworks, like swing, to calculate desired values for RUN_DIRECTION and NUMERIC_SHAPING based on locale or user preferences, and allow clients' text rendering to reflect these values, without clients having to change their code.
It is desireable to let one framework (such as swing, or a parent component) compute and set some text attributes for a client (a child component, or a user of a swing component). It is also desireable that clients not have to change their code in order to access this functionality.
It is proposed that new state be added to Graphics2D to hold the full complement of TextAttributes. Methods will be added to let clients modify and query the attributes used for rendering. The semantics of setFont and the relationship of the font and its attributes to the graphic's attributes will be clarified.
This will allow frameworks, like swing, to calculate desired values for RUN_DIRECTION and NUMERIC_SHAPING based on locale or user preferences, and allow clients' text rendering to reflect these values, without clients having to change their code.
- duplicates
-
JDK-4828102 Need API to get/set TextAttribute on Graphics2D
- Closed