Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4372591

add TextAttribute state to Graphics2D, getters/setters

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • None
    • 2d
    • 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.

            dougfelt Doug Felt
            dougfelt Doug Felt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: