Class TextDrawInfo


  • public class TextDrawInfo
    extends java.lang.Object
    Properties for rendering text.

    The number of properties available for the rendering of text has been growing as more features are added to AXTE. This class caches all of those properties. Instead ofusing forever growing parameter lists, the client creates an instance of this class, populates on the properties relevant to its usage, and then calls the appropriate rendering method.

    Currently, the following properties are supported. All are optional, except for the graphics environment.

  • Graphic Enviornment: Graphic environment in which rendering is to occur.
  • Invalidation rectangle: On a repaint, this is the damage area of the rendering target that needs to be updated. It is specified in text object-relative coordinates. It can also be used for coarse control over what gets rendered. In order to be drawn in a rendering call, a glyph must overlap the invalidation rectangle. The default is a degenerate rectangle at (0,0). This is defaulted at draw time according to the invalid default setting (see below).
  • Page rectangle: Describes the extents of the page in page-absolute coordinates. Typically, the left and top are zero, and the right and bottom are the width and height of the page, respectively. The default is a degenerate page at (0,0). The page rectangle is currently used only for aligning leader patterns. Text outside the page rectangle will be rendered if it meets other constraints.
  • Primary selection: Pointer to a text selection (TextSelection) object, describing a range of selected text along with foreground and background colours, that may require different rendering from the rest of the text. Default is the null pointer, indicating there is no primary selection in effect. Note that, in bidirectional text, selections may not be visually contiguous.
  • Secondary selection: A second, lower priority selection. Default is the null pointer, indicating there is no secondary selection in effect. Note that the primary and secondary selections may have different ranges and colours. If both are specified and overlap, text in the overlap area is rendered with the primary selection properties. a secondary selection might be used to highlight a fillable field within flowing form letter content.
  • Invalid default: An enumeration that describes how to to determine a default value for the invalidation rectangle if none is provided.
  • Truncate: If true, glyphs must be entirely inside the text object's extent in order to be renered. If a glyph straddles the extend boundary or is entirely outside the extent, it will not be rendered. If there is also an invalidation rectangle, either specified or defaulted, the glyph must satisfy the invalidation constraints as well in order to be rendered. If this property is false, no truncation is in effect.
  • Obtimization level: This property is largely deprecated, as all "real" rendering targets support the maximum level of render optimization. It is used only in some test environments. Text is rendered line by line. Within each line, text is normally rendered in maximal runs. A run is rendered by explicitly positioining and then putting out one or more glyphs, with an implicit update after each. The default value for this property is OPT_LINE, which instructs AXTE generate maximal runs for the line. Other values are OPT_WORD, which causes an additional position/run break at the start of each word; and OPT_CHAR, which causes a position/run break on each glyph.