Package com.adobe.xfa.text
Class TextDrawInfo
java.lang.Object
com.adobe.xfa.text.TextDrawInfo
Properties for rendering text.
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 (
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.
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.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUse the computed size of the text object.static final intUse the declared size of the text object.static final intUse the text display's runtime extent. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the graphic environment.Retrieve the invalidation rectangle.intRetrieve the default invalidation rectangle setting.getPage()Retrieve the page rectangle.Retrieve the primary selection.Retrieve the secondary selection.booleanRetrieve the truncate flag.voidsetInvalid(Rect oInvalid) Set the invalidation rectangle.voidsetInvalidDefault(int eInvalidDefault) Set the default invalidation rectangle setting.voidSet the page rectangle.voidsetPrimary(TextSelection poPrimary) Set the primary selection.voidsetSecondary(TextSelection poSecondary) Set the secondary selection.voidsetTruncate(boolean bTruncate) Set the truncate flag.
-
Field Details
-
INVALID_DEFAULT_RUNTIME_EXTENT
public static final int INVALID_DEFAULT_RUNTIME_EXTENTUse the text display's runtime extent. Note that some trailing spaces may not be included in the runtime extent.- See Also:
-
INVALID_DEFAULT_DECLARED_SIZE
public static final int INVALID_DEFAULT_DECLARED_SIZEUse the declared size of the text object. If text overflows the declared size, it may not be drawn.- See Also:
-
INVALID_DEFAULT_AUGMENTED_SIZE
public static final int INVALID_DEFAULT_AUGMENTED_SIZEUse the computed size of the text object. This will include any overflowing text and trailing spaces.- See Also:
-
-
Constructor Details
-
TextDrawInfo
Constructor. All properties except graphic environment are set to defaults as described above.- Parameters:
oGfxEnv- - Graphic environment to use for rendering.
-
-
Method Details
-
getGfxEnv
Retrieve the graphic environment.- Returns:
- Graphic environment reference cached in this object.
-
getInvalid
Retrieve the invalidation rectangle.- Returns:
- Invalidation rectangle. For more information, please see above.
-
setInvalid
Set the invalidation rectangle.- Parameters:
oInvalid- - Invalidation rectangle. For more information, please see above.
-
getPage
Retrieve the page rectangle.- Returns:
- Page rectangle. For more information, please see above.
-
setPage
Set the page rectangle.- Parameters:
oPage- - Page rectangle. For more information, please see above.
-
getPrimary
Retrieve the primary selection.- Returns:
- Primary selection. For more information, please see above.
-
setPrimary
Set the primary selection.- Parameters:
poPrimary- - Primary selection. For more information, please see above.
-
getSecondary
Retrieve the secondary selection.- Returns:
- Secondary selection. For more information, please see above.
-
setSecondary
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.
-