Package com.adobe.xfa.text
Class TextDrawInfo
- java.lang.Object
-
- com.adobe.xfa.text.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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
INVALID_DEFAULT_AUGMENTED_SIZE
Use the computed size of the text object.static int
INVALID_DEFAULT_DECLARED_SIZE
Use the declared size of the text object.static int
INVALID_DEFAULT_RUNTIME_EXTENT
Use the text display's runtime extent.
-
Constructor Summary
Constructors Constructor Description TextDrawInfo(GFXEnv oGfxEnv)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GFXEnv
getGfxEnv()
Retrieve the graphic environment.Rect
getInvalid()
Retrieve the invalidation rectangle.int
getInvalidDefault()
Retrieve the default invalidation rectangle setting.Rect
getPage()
Retrieve the page rectangle.TextSelection
getPrimary()
Retrieve the primary selection.TextSelection
getSecondary()
Retrieve the secondary selection.boolean
getTruncate()
Retrieve the truncate flag.void
setInvalid(Rect oInvalid)
Set the invalidation rectangle.void
setInvalidDefault(int eInvalidDefault)
Set the default invalidation rectangle setting.void
setPage(Rect oPage)
Set the page rectangle.void
setPrimary(TextSelection poPrimary)
Set the primary selection.void
setSecondary(TextSelection poSecondary)
Set the secondary selection.void
setTruncate(boolean bTruncate)
Set the truncate flag.
-
-
-
Field Detail
-
INVALID_DEFAULT_RUNTIME_EXTENT
public static final int INVALID_DEFAULT_RUNTIME_EXTENT
Use the text display's runtime extent. Note that some trailing spaces may not be included in the runtime extent.- See Also:
- Constant Field Values
-
INVALID_DEFAULT_DECLARED_SIZE
public static final int INVALID_DEFAULT_DECLARED_SIZE
Use the declared size of the text object. If text overflows the declared size, it may not be drawn.- See Also:
- Constant Field Values
-
INVALID_DEFAULT_AUGMENTED_SIZE
public static final int INVALID_DEFAULT_AUGMENTED_SIZE
Use the computed size of the text object. This will include any overflowing text and trailing spaces.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextDrawInfo
public TextDrawInfo(GFXEnv oGfxEnv)
Constructor. All properties except graphic environment are set to defaults as described above.- Parameters:
oGfxEnv
- - Graphic environment to use for rendering.
-
-
Method Detail
-
getGfxEnv
public GFXEnv getGfxEnv()
Retrieve the graphic environment.- Returns:
- Graphic environment reference cached in this object.
-
getInvalid
public Rect getInvalid()
Retrieve the invalidation rectangle.- Returns:
- Invalidation rectangle. For more information, please see above.
-
setInvalid
public void setInvalid(Rect oInvalid)
Set the invalidation rectangle.- Parameters:
oInvalid
- - Invalidation rectangle. For more information, please see above.
-
getPage
public Rect getPage()
Retrieve the page rectangle.- Returns:
- Page rectangle. For more information, please see above.
-
setPage
public void setPage(Rect oPage)
Set the page rectangle.- Parameters:
oPage
- - Page rectangle. For more information, please see above.
-
getPrimary
public TextSelection getPrimary()
Retrieve the primary selection.- Returns:
- Primary selection. For more information, please see above.
-
setPrimary
public void setPrimary(TextSelection poPrimary)
Set the primary selection.- Parameters:
poPrimary
- - Primary selection. For more information, please see above.
-
getSecondary
public TextSelection getSecondary()
Retrieve the secondary selection.- Returns:
- Secondary selection. For more information, please see above.
-
setSecondary
public void setSecondary(TextSelection poSecondary)
Set the secondary selection.- Parameters:
poSecondary
- - Secondary selection. For more information, please see above.
-
getInvalidDefault
public int getInvalidDefault()
Retrieve the default invalidation rectangle setting.- Returns:
- Default invalidation rectangle setting. For more information, please see above.
-
setInvalidDefault
public void setInvalidDefault(int eInvalidDefault)
Set the default invalidation rectangle setting.- Parameters:
eInvalidDefault
- - Default invalidation rectangle setting. For more information, please see above.
-
getTruncate
public boolean getTruncate()
Retrieve the truncate flag.- Returns:
- Truncate flag. For more information, please see above.
-
setTruncate
public void setTruncate(boolean bTruncate)
Set the truncate flag.- Parameters:
bTruncate
- - Truncate flag. For more information, please see above.
-
-