public class TextAttr extends TextGfxAttr
The text attribute object can represent any possible combination of attributes that apply to text (e.g., typeface, size, left margin, tabs). Applications use this object to set and query rich text attributes.
Note that, for architectural reasons, this class extends class TextGfxAttr. Class TextGfxAttr provides sparse attribute coverage for so-called "graphic" text attributes (e.g., colour, underline). Class TextAttr extends that with all other attributes that apply to text. For more information on graphic text attributes, please see class TextGfxAttr.
Each text attribute can be set or queried independently. Additionally, each attribute can be flagged as enabled or disabled. When enabled, the corresponding attribute value has meaning. When disabled, the value can be thought of as unknown or irrelevant. To set a single text attribute over a range of text, the application creates a TextAttr with just that attribute enabled, and applies it to the range. Similarly, the application can apply a subset of attributes by enabling just those values. The application can also query attributes over a range. Those attributes that are constant over the range will appear as enabled values in the resulting TextAttr object. Those that vary over the range are disabled.
This object has a large number of accessors, which appear in groups of four, one such group for each attribute. For example, consider the typeface attribute. There are two overloads each of Typeface() and TypefaceEnable(). In each overload pair, one sets the value and one retrieves it. In other words, one Typeface() overload returns the current typeface value and one sets it, and one TypefaceEnable() overload returns the enabled state and one sets it. Enabled flags are all Boolean, with TRUE indicating the value is enabled. Setting an attribute value in a TextAttr object (e.g., by second Typeface() overload) automatically enables it. Enabling a value (e.g., by second TypefaceEnable() overload) that has never been set usually sets it to a default value. In rare cases, the uninitialized value may be left disabled.
Some attributes apply at the paragraph level while other can apply to smaller runs of text. When the application sets paragraph attributes over a text range, the range is implicitly rounded up to complete paragraphs for the paragraph attributes.
Font information may be set by individual components (e.g., typeface, size) or by font object pointer.
Constructor and Description |
---|
TextAttr()
Default constructor.
|
TextAttr(boolean bDefault)
Constructor with control over defaulting technique.
|
TextAttr(TextAttr oSource)
Copy constructor.
|
TextAttr(TextAttr oSource,
TextGfxSource oGfxSource)
Copy constructor with graphic source.
|
Modifier and Type | Method and Description |
---|---|
String |
actualLocale()
Resolve the locale for the text attribute object.
|
void |
addDisabled(TextAttr oSource)
Partial copy, filling in disabled attributes.
|
boolean |
anyFontEnable()
Query whether any of the font attributes is enabled
|
TextBaselineShift |
baselineShift()
Return the baseline shift if enabled
|
void |
baselineShift(TextBaselineShift oNewShift)
Set and enable the baseline shift
|
boolean |
baselineShiftEnable()
Query whether the baseline shift is enabled
|
void |
baselineShiftEnable(boolean bNewEnable)
Enable/disable the baseline shift
|
TextMeasurement |
charSpacing()
Returns the character spacing setting for this text attribute object.
|
void |
charSpacing(TextMeasurement nNewCharSpacing)
Set a new character spacing value for this attribute object.
|
boolean |
charSpacingEnable()
Query whether the character spacing setting is enabled in this text
attribute object.
|
void |
charSpacingEnable(boolean bNewEnable)
Enable or disable the character spacing setting in this attribute
object.
|
TextAttr |
conditionalFlatten()
Perform flattening without affecting this object.
|
void |
copyFrom(TextAttr oSource)
Replace all attributes with those from the source object.
|
void |
debug() |
static TextAttr |
defaultAttr(boolean bDefault)
Return a reference to a constant default text attribute object.
|
int |
digits() |
void |
digits(int eNewDigits) |
boolean |
digitsEnable() |
void |
digitsEnable(boolean bNewEnable) |
int |
direction()
Return the direction for neutral characters.
|
void |
direction(int eNewDirection)
Set the direction for neutral characters.
|
boolean |
directionEnable()
Query whether the neutral character direction value is enabled
|
void |
directionEnable(boolean bNewEnable)
Enable/disable the neutral character direction value
|
void |
dropDiff(TextAttr oCompare)
Disable attributes where different.
|
void |
dropSame(TextAttr oCompare) |
void |
dropSame(TextAttr oCompare,
boolean bPreserveGfx)
Disable attributes where same.
|
void |
enableFloat(int nIndex,
boolean bEnable) |
String |
encoding()
Return the encoding value if enabled
|
void |
encoding(String sNewEncoding)
Set and enable the encoding value
|
boolean |
encodingEnable()
Query whether the encoding value is enabled
|
void |
encodingEnable(boolean bNewEnable)
Enable/disable the encoding value
|
boolean |
equals(Object object)
Equality comparison operator.
|
boolean |
flatten()
Flatten relative measurements to absolute values.
|
UnitSpan |
flattenMeasurement(TextMeasurement oMeasurement)
Flatten a measurement in the context of this attribute.
|
boolean |
fontEnable()
Query whether the font value is enabled
|
void |
fontEnable(boolean bNewEnable)
Enable/disable the font value
|
FontInstance |
fontInstance()
Return the font instance value if enabled
|
void |
fontInstance(FontInstance oNewFont) |
void |
fontInstance(FontInstance oNewFont,
String sOriginalTypeface)
Set and enable the font instance value
|
FontService |
fontService()
Get a pointer to the FontService object used by this stream.
|
void |
fontService(FontService poNewFontService) |
void |
fontService(FontService poNewFontService,
boolean bSuppressReconcile)
Set the FontService object used by this stream.
|
static String |
formatPercent(double dRelative)
Format a relative value as a percentage.
|
double |
getFloatValue(int nIndex) |
TextAttr |
getOriginalAttr()
Return the original attribute object from one that has had its
baseline shift flattened.
|
TextGfxSource |
gfxSource()
Obtain graphic source information used by the stream.
|
void |
gfxSource(TextGfxSource oNewGfxSource)
Change the graphic source used by the stream.
|
GFXTextAttr |
gfxTextAttr()
Query the collected graphic text attributes
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
hasParaAttrs()
Determine whether any paragraph attribute is enabled
|
double |
horizontalScale()
Query the horizontal scale.
|
void |
horizontalScale(double nNewHorizontalScale)
Set the horizontal scale factor.
|
boolean |
horizontalScaleEnable()
Query whether the horizontal scale value is enabled
|
void |
horizontalScaleEnable(boolean bNewEnable)
Enable/disable the horizontal scale value
|
int |
hyphLevel()
Return the hyphenation level if enabled
|
void |
hyphLevel(int eNewHyphLevel)
Set and enable the hyphenation level
|
boolean |
hyphLevelEnable()
Query whether the hyphenation level is enabled
|
void |
hyphLevelEnable(boolean bNewEnable)
Enable/disable the hyphenation level
|
int |
hyphMaxLines()
Return the maximum consecutive hyphenated lines if enabled
|
void |
hyphMaxLines(int nNewHyphMaxLines)
Set and enable the hyphenation maximum consecutive hyphenated lines
|
boolean |
hyphMaxLinesEnable()
Query whether the maximum consecutive hyphenated lines is enabled
|
void |
hyphMaxLinesEnable(boolean bNewEnable)
Enable/disable the hyphenation maximum consecutive hyphenated lines
|
int |
hyphMinPrefix()
Return the hyphenation minimum prefix size if enabled
|
void |
hyphMinPrefix(int nNewHyphMinPrefix)
Set and enable the hyphenation minimum prefix size
|
boolean |
hyphMinPrefixEnable()
Query whether the hyphenation minimum prefix size is enabled
|
void |
hyphMinPrefixEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum prefix size
|
int |
hyphMinSuffix()
Return the hyphenation minimum suffix size if enabled
|
void |
hyphMinSuffix(int nNewHyphMinSuffix)
Set and enable the hyphenation minimum suffix size
|
boolean |
hyphMinSuffixEnable()
Query whether the hyphenation minimum suffix size is enabled
|
void |
hyphMinSuffixEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum suffix size
|
int |
hyphMinWord()
Return the hyphenation minimum word size if enabled
|
void |
hyphMinWord(int nNewHyphMinWord)
Set and enable the hyphenation minimum word size
|
boolean |
hyphMinWordEnable()
Query whether the hyphenation minimum word size is enabled
|
void |
hyphMinWordEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum word size
|
boolean |
hyphSuppressAcronyms()
Return the hyphenation suppress acronyms if enabled
|
void |
hyphSuppressAcronyms(boolean bNewHyphSuppressAcronyms)
Set and enable the hyphenation suppress acronyms
|
boolean |
hyphSuppressAcronymsEnable()
Query whether the hyphenation suppress acronyms is enabled
|
void |
hyphSuppressAcronymsEnable(boolean bNewEnable)
Enable/disable the hyphenation suppress acronyms
|
boolean |
hyphSuppressNames()
Return the hyphenation suppress formal names if enabled
|
void |
hyphSuppressNames(boolean bNewHyphSuppressNames)
Set and enable the hyphenation suppress formal names
|
boolean |
hyphSuppressNamesEnable()
Query whether the hyphenation suppress formal names is enabled
|
void |
hyphSuppressNamesEnable(boolean bNewEnable)
Enable/disable the hyphenation suppress formal names
|
char |
invisChar()
Return the invisible character if enabled
|
void |
invisChar(char cNewInvisChar)
Set and enable the invisible character
|
boolean |
invisCharEnable()
Query whether the invisible character is enabled
|
void |
invisCharEnable(boolean bNewEnable)
Enable/disable the invisible character
|
boolean |
invisible()
Return the invisible flag if enabled
|
void |
invisible(boolean bNewInvisible)
Set and enable the invisible flag
|
boolean |
invisibleEnable()
Query whether the invisible flag is enabled
|
void |
invisibleEnable(boolean bNewEnable)
Enable/disable the invisible flag
|
boolean |
isComplete()
Determine whether all attributes are enabled
|
boolean |
isEmpty()
Determine whether all attributes are disabled
|
boolean |
isFloatEnabled(int nIndex) |
void |
isolatePara(boolean bKeep) |
void |
isolatePara(boolean bKeep,
boolean bLegacyPositioning)
Isolate paragraph attributes.
|
boolean |
italic()
Return the italic value if enabled
|
void |
italic(boolean bNewItalic)
Set and enable the italic value
|
boolean |
italicEnable()
Query whether the italic value is enabled
|
void |
italicEnable(boolean bNewEnable)
Enable/disable the italic value
|
int |
justifyH()
Return the horizontal justification if enabled
|
void |
justifyH(int eNewJustifyH)
Set and enable the horizontal justification
|
boolean |
justifyHEnable()
Query whether the horizontal justification is enabled
|
void |
justifyHEnable(boolean bNewEnable)
Enable/disable the horizontal justification
|
int |
justifyV()
Return the vertical justification if enabled
|
void |
justifyV(int eNewJustifyV)
Set and enable the vertical justification
|
boolean |
justifyVEnable()
Query whether the vertical justification is enabled
|
void |
justifyVEnable(boolean bNewEnable)
Enable/disable the vertical justification
|
boolean |
kerning()
Returns the kerning setting for this text attribute object.
|
void |
kerning(boolean bNewKerning)
Set a new kerning value for this attribute object.
|
boolean |
kerningEnable()
Query whether the kerning setting is enabled in this text attribute
object.
|
void |
kerningEnable(boolean bNewEnable)
Enable or disable the kerning setting in this attribute object.
|
int |
layoutOrientation()
Return the layout orientation in effect.
|
void |
layoutOrientation(int eNewLayoutOrientation)
Set the layout orientation.
|
boolean |
layoutOrientationEnable()
Query whether the layout orientation is enabled.
|
void |
layoutOrientationEnable(boolean bNewEnable)
Enable the layout orientation value.
|
int |
leaderAlign()
Retrieve the leader alignment currently in effect.
|
void |
leaderAlign(int eNewLeaderAlign)
Change the leader alignment property in this attribute object.
|
boolean |
leaderAlignEnable()
Query whether the leader alignment is enabled.
|
void |
leaderAlignEnable(boolean bNewEnable)
Enable/disable the leader alignment.
|
TextStream |
leaderContent()
Retrieve the leader content currently in effect.
|
void |
leaderContent(TextStream oNewLeaderContent)
Change the leader content property in this attribute object.
|
boolean |
leaderContentEnable()
Query whether the leader content is enabled.
|
void |
leaderContentEnable(boolean bNewEnable)
Enable/disable the leader content.
|
int |
leaderPattern()
Retrieve the leader pattern currently in effect.
|
void |
leaderPattern(int eNewLeaderPattern)
Change the leader pattern property in this attribute object.
|
boolean |
leaderPatternEnable()
Query whether the leader pattern is enabled.
|
void |
leaderPatternEnable(boolean bNewEnable)
Enable/disable the leader pattern.
|
TextMeasurement |
leaderPatternWidth()
Retrieve the leader pattern width currently in effect.
|
void |
leaderPatternWidth(TextMeasurement oNewLeaderPatternWidth)
Change the leader pattern width property in this attribute object.
|
boolean |
leaderPatternWidthEnable()
Query whether the leader pattern width is enabled.
|
void |
leaderPatternWidthEnable(boolean bNewEnable)
Enable/disable the leader pattern width.
|
int |
ligature()
Return the ligature level.
|
void |
ligature(int eNewLigature)
Set the ligature level.
|
boolean |
ligatureEnable()
Query whether the ligature level is enabled.
|
void |
ligatureEnable(boolean bNewEnable)
Enable/disable the ligature level.
|
String |
locale()
Return the locale value if enabled
|
void |
locale(String sNewLocale)
Set and enable the locale value
|
boolean |
localeEnable()
Query whether the locale value is enabled
|
void |
localeEnable(boolean bNewEnable)
Enable/disable the locale value
|
TextMeasurement |
marginL()
Return the left margin if enabled
|
void |
marginL(TextMeasurement oNewMarginL)
Set and enable the left margin
|
boolean |
marginLEnable()
Query whether the left margin is enabled
|
void |
marginLEnable(boolean bNewEnable)
Enable/disable the left margin
|
TextMeasurement |
marginR()
Return the right margin if enabled
|
void |
marginR(TextMeasurement oNewMarginR)
Set and enable the right margin
|
boolean |
marginREnable()
Query whether the right margin is enabled
|
void |
marginREnable(boolean bNewEnable)
Enable/disable the right margin
|
static boolean |
match(TextAttr poAttr1,
TextAttr poAttr2) |
boolean |
notEqual(TextAttr oCompare)
Inequality comparison operator.
|
String |
originalTypeface()
Return the OriginalTypeface value
|
void |
override(TextAttr oOverride) |
void |
override(TextAttr oOverride,
TextAttr poDiffs)
Partial copy, selecting enabled attributes in the source.
|
int |
paraDirection()
Return the paragraph direction.
|
void |
paraDirection(int eNewDirection)
Change the paragraph direction.
|
boolean |
paraDirectionEnable()
Query whether the paragraph character direction value is enabled.
|
void |
paraDirectionEnable(boolean bNewEnable)
Enable/disable the paragraph character direction value.
|
static double |
parsePercent(String sText,
boolean bAllowNegative)
Parse a persentage string to get a relative value.
|
char |
radixChar()
Return the radix character, resolved by locale.
|
TextMeasurement |
radixOffset()
Return the radix offset value if enabled
|
void |
radixOffset(TextMeasurement oNewRadixOffset)
Set and enable the radix offset value
|
boolean |
radixOffsetEnable()
Query whether the radix offset value is enabled
|
void |
radixOffsetEnable(boolean bNewEnable)
Enable/disable the radix offset value
|
int |
radixPos()
Get the radix position value
|
void |
radixPos(int nNewRadixPos)
Set the radix position value
|
boolean |
radixPosEnable()
Query whether the radix position value is enabled
|
void |
radixPosEnable(boolean bNewEnable)
Enable/disable the radix position value
|
String |
radixText()
Return the radix text string, resolved by locale.
|
int |
ruleStyle()
Retrieve the rule style currently in effect.
|
void |
ruleStyle(int eNewRuleStyle)
Change the rule style property in this attribute object.
|
boolean |
ruleStyleEnable()
Query whether the rule style is enabled.
|
void |
ruleStyleEnable(boolean bNewEnable)
Enable/disable the rule style.
|
TextMeasurement |
ruleThickness()
Retrieve the rule thickness currently in effect.
|
void |
ruleThickness(TextMeasurement oNewRuleThickness)
Change the rule thickness property in this attribute object.
|
boolean |
ruleThicknessEnable()
Query whether the rule thickness is enabled.
|
void |
ruleThicknessEnable(boolean bNewEnable)
Enable/disable the rule thickness.
|
void |
setDefault(boolean bDefault)
Fill the text attribute holder with default values.
|
void |
setFloatValue(int nIndex,
double nNewValue) |
void |
setFloatValue(int nIndex,
double nNewValue,
boolean bEnable) |
UnitSpan |
size()
Return the size value if enabled
|
void |
size(UnitSpan oNewSize)
Set and enable the size value
|
boolean |
sizeEnable()
Query whether the size value is enabled
|
void |
sizeEnable(boolean bNewEnable)
Enable/disable the size value
|
TextMeasurement |
spaceAfter()
Return the vertical space after paragraph value if enabled
|
void |
spaceAfter(TextMeasurement oNewSpaceAfter)
Set and enable the vertical space after paragraph value
|
boolean |
spaceAfterEnable()
Query whether the vertical space after paragraph value is enabled
|
void |
spaceAfterEnable(boolean bNewEnable)
Enable/disable the vertical space after paragraph value
|
TextMeasurement |
spaceBefore()
Return the vertical space before paragraph value if enabled
|
void |
spaceBefore(TextMeasurement oNewSpaceBefore)
Set and enable the vertical space before paragraph value
|
boolean |
spaceBeforeEnable()
Query whether the vertical space before paragraph value is enabled
|
void |
spaceBeforeEnable(boolean bNewEnable)
Enable/disable the vertical space before paragraph value
|
TextMeasurement |
spacing()
Return the line spacing if enabled
|
void |
spacing(TextMeasurement oNewSpacing)
Set and enable the line spacing
|
boolean |
spacingEnable()
Query whether the line spacing is enabled
|
void |
spacingEnable(boolean bNewEnable)
Enable/disable the line spacing
|
TextMeasurement |
special()
Return the special first line handling value if enabled
|
void |
special(TextMeasurement oNewSpecial)
Set and enable the special first line handling value
|
boolean |
specialEnable()
Query whether the special first line handling value is enabled
|
void |
specialEnable(boolean bNewEnable)
Enable/disable the special first line handling value
|
boolean |
substituteFont()
Return if the font instance is a substitute font
|
TextTabList |
tabs()
Return the tab list if enabled
|
void |
tabs(TextTabList oNewTabs)
Set and enable the tab list
|
boolean |
tabsEnable()
Query whether the tab list is enabled
|
void |
tabsEnable(boolean bNewEnable)
Enable/disable the tab list
|
boolean |
transparent()
Return the transparent flag if enabled
|
void |
transparent(boolean bNewTransparent)
Set and enable the transparent flag
|
boolean |
transparentEnable()
Query whether the transparent flag is enabled
|
void |
transparentEnable(boolean bNewEnable)
Enable/disable the transparent flag
|
String |
typeface()
Return the Typeface value if enabled
|
void |
typeface(String sNewTypeface)
Set and enable the typeface value
|
void |
typeface(String sNewTypeface,
int nWeight,
boolean bItalic,
String sEncoding)
Set and enable the typeface value
|
void |
typeface(String sNewTypeface,
UnitSpan oSize,
int nWeight,
int nItalic)
Set and enable one or more of typeface, size, weight and italic.
|
boolean |
typefaceEnable()
Query whether the typeface value is enabled
|
void |
typefaceEnable(boolean bNewEnable)
Enable/disable the typeface value
|
void |
updateFont() |
void |
updateFont(FontInstance oNewFont,
String sOriginalTypeface) |
void |
updateFont(FontInstance oNewFont,
String sOriginalTypeface,
boolean bUpdateOptional) |
void |
updateFont(com.adobe.xfa.text.TextAttr.FontDesc oNewFontDesc) |
void |
updateFont(TextAttr oSource) |
double |
verticalScale()
Query the Vertical scale.
|
void |
verticalScale(double nNewVerticalScale)
Set the vertical scale factor.
|
boolean |
verticalScaleEnable()
Query whether the vertical scale value is enabled
|
void |
verticalScaleEnable(boolean bNewEnable)
Enable/disable the vertical scale value
|
int |
weight()
Return the weight value if enabled
|
void |
weight(int iNewWeight)
Set and enable the weight value
|
boolean |
weightEnable()
Query whether the weight value is enabled
|
void |
weightEnable(boolean bNewEnable)
Enable/disable the weight value
|
TextMeasurement |
wordSpacing()
Returns the word spacing setting for this text attribute object.
|
void |
wordSpacing(TextMeasurement nNewWordSpacing)
Set a new word spacing value for this attribute object.
|
boolean |
wordSpacingEnable()
Query whether the word spacing setting is enabled in this text
attribute object.
|
void |
wordSpacingEnable(boolean bNewEnable)
Enable or disable the word spacing setting in this attribute object.
|
anyGfxEnable, colour, colour, colourBg, colourBg, colourBgEnable, colourBgEnable, colourEnable, colourEnable, copyFrom, getGfxTextAttr, gfxTextAttrEnable, graphicContext, graphicContext, graphicContextEnable, graphicContextEnable, notEqual, overline, overline, overlineEnable, overlineEnable, setGfxTextAttrDefault, shade, shade, shadeEnable, shadeEnable, shadeScale, shadeScale, shadeScaleEnable, shadeScaleEnable, strikeout, strikeout, strikeoutEnable, strikeoutEnable, style, style, styleEnable, styleEnable, textContext, textContext, textContextEnable, textContextEnable, underline, underline, underlineEnable, underlineEnable
public static final int JUST_V_UNKNOWN
public static final int JUST_V_TOP
public static final int JUST_V_MIDDLE
public static final int JUST_V_BOTTOM
public static final int JUST_H_UNKNOWN
public static final int JUST_H_LEFT
public static final int JUST_H_CENTRE
public static final int JUST_H_RIGHT
public static final int JUST_H_SPREAD
public static final int JUST_H_SPREAD_ALL
public static final int JUST_H_RADIX
public static final int JUST_H_COMB_LEFT
public static final int JUST_H_COMB_CENTRE
public static final int JUST_H_COMB_RIGHT
public static final int DIGITS_LOCALE
public static final int DIGITS_ARABIC
public static final int DIGITS_INDIC
public static final int DIRECTION_NEUTRAL
public static final int DIRECTION_LTR
public static final int DIRECTION_RTL
public static final int ORIENTATION_HORIZONTAL
public static final int ORIENTATION_VERTICAL_LTR
public static final int ORIENTATION_VERTICAL_RTL
public static final int LIGATURE_MINIMUM
public static final int LIGATURE_COMMON
public static final int HYPHEN_OFF
public static final int HYPHEN_PREFERRED
public static final int HYPHEN_NORMAL
public static final int HYPHEN_ALL
public static final int LEADER_PATTERN_SPACE
public static final int LEADER_PATTERN_RULE
public static final int LEADER_PATTERN_DOTS
public static final int LEADER_PATTERN_USE_CONTENT
public static final int LEADER_ALIGN_NONE
public static final int LEADER_ALIGN_PAGE
public static final int RULE_STYLE_NONE
public static final int RULE_STYLE_SOLID
public static final int RULE_STYLE_DOTTED
public static final int RULE_STYLE_DASHED
public static final int DEFAULT_HYPH_LEVEL
public static final int DEFAULT_HYPH_MIN_WORD
public static final int DEFAULT_HYPH_MIN_PREFIX
public static final int DEFAULT_HYPH_MIN_SUFFIX
public static final int DEFAULT_HYPH_MAX_LINES
public static final boolean DEFAULT_HYPH_SUPPRESS_NAMES
public static final boolean DEFAULT_HYPH_SUPPRESS_ACRONYMS
public static final int DEFAULT_LEADER_PATTERN
public static final int DEFAULT_LEADER_ALIGN
public static final int DEFAULT_RULE_STYLE
public static final TextAttr defaultFull
public static final TextAttr defaultEmpty
public TextAttr()
Populates the text attribute object with all attributes disabled.
public TextAttr(boolean bDefault)
This constructor can behave like the default constructor (all attributes disabled) or it can create the object with attributes enabled and set to default values.
bDefault
- - FALSE if attributes are to be disabled; TRUE if
they are to be enabled with default values.public TextAttr(TextAttr oSource)
Copies all attributes and their enabled/disabled status. This also copies the graphic source connection of the source attribute object.
oSource
- - Source attribute object to copy.public TextAttr(TextAttr oSource, TextGfxSource oGfxSource)
Copies all attributes and their enabled/disabled status, but reestablishes them in the context of a different graphic source.
oSource
- - Source attribute object to copy.oGfxSource
- - Graphic source to use for the copy.public TextGfxSource gfxSource()
AXTE collects the various sources and pools of graphic information (text and Gfx attribute pools, and font mapper) into a text graphic source object (TextGfxSource). This method returns the current graphic source of the stream.
public void gfxSource(TextGfxSource oNewGfxSource)
AXTE collects the various sources and pools of graphic information (text and Gfx attribute pools, and font mapper) into a text graphic source object (TextGfxSource). This method allows the caller to change the object's graphic source.
oNewGfxSource
- - New graphic source to use for the object.public FontService fontService()
The font service object used CoolType font handling to create and look up fonts. A text stream may use a font service instead of a text attribute pool; it may use the font service that comes from the text attribute pool; or it may not use a font service at all, though this may cause limitations with certain drivers. This method returns a pointer to the font service currently in use.
public void fontService(FontService poNewFontService, boolean bSuppressReconcile)
The font service object used CoolType font handling to create and look up fonts. A text stream may use a font service instead of a text attribute pool; it may use the font service that comes from the text attribute pool; or it may not use a font service at all, though this may cause limitations with certain drivers. This method establishes a new font service for the stream.
poNewFontService
- Pointer to new font service to use. May be
NULL.bSuppressReconcile
- - (optional) TRUE to prevent immediate
reconcilation of the attribute's font info in the new service; FALSE
(default) to have the reconcile occur.public void fontService(FontService poNewFontService)
public FontInstance fontInstance()
public void fontInstance(FontInstance oNewFont, String sOriginalTypeface)
oNewFont
- - New font instance value. Note: setting the font
instance value to a NULL pointer disables it.sOriginalTypeface
- - Original typeface value for substituted fonts.public void fontInstance(FontInstance oNewFont)
public boolean substituteFont()
public boolean fontEnable()
public void fontEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the font value is to be enabled; FALSE if
it is to be disabled.public boolean anyFontEnable()
public String typeface()
public void typeface(String sNewTypeface, int nWeight, boolean bItalic, String sEncoding)
sNewTypeface
- - New typeface value.nWeight
- - bold attribute.bItalic
- - Italicize.public void typeface(String sNewTypeface)
sNewTypeface
- - New typeface value.public void typeface(String sNewTypeface, UnitSpan oSize, int nWeight, int nItalic)
sNewTypeface
- - New typeface value.oSize
- - New size value.nWeight
- - New weight value.nItalic
- - New italic value.public boolean typefaceEnable()
public void typefaceEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the typeface value is to be enabled;
FALSE if it is to be disabled.public String originalTypeface()
public String encoding()
public void encoding(String sNewEncoding)
sNewEncoding
- - New encoding value.public boolean encodingEnable()
public void encodingEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the encoding value is to be enabled;
FALSE if it is to be disabled.public UnitSpan size()
public void size(UnitSpan oNewSize)
oNewSize
- - New size value.public boolean sizeEnable()
public void sizeEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the size value is to be enabled; FALSE if
it is to be disabled.public int weight()
public void weight(int iNewWeight)
iNewWeight
- - New weight value.public boolean weightEnable()
public void weightEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the weight value is to be enabled; FALSE
if it is to be disabled.public boolean italic()
public void italic(boolean bNewItalic)
bNewItalic
- - New italic value.public boolean italicEnable()
public void italicEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the italic value is to be enabled; FALSE
if it is to be disabled.public GFXTextAttr gfxTextAttr()
public boolean transparent()
public void transparent(boolean bNewTransparent)
bNewTransparent
- - New transparent flag.public boolean transparentEnable()
public void transparentEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the transparent flag is to be enabled;
FALSE if it is to be disabled.public TextMeasurement spacing()
public void spacing(TextMeasurement oNewSpacing)
oNewSpacing
- - New line spacing.public boolean spacingEnable()
public void spacingEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the line spacing is to be enabled; FALSE
if it is to be disabled.public TextMeasurement marginL()
public void marginL(TextMeasurement oNewMarginL)
oNewMarginL
- - New left margin.public boolean marginLEnable()
public void marginLEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the left margin is to be enabled; FALSE
if it is to be disabled.public TextMeasurement marginR()
public void marginR(TextMeasurement oNewMarginR)
oNewMarginR
- - New right margin.public boolean marginREnable()
public void marginREnable(boolean bNewEnable)
bNewEnable
- - TRUE if the right margin is to be enabled; FALSE
if it is to be disabled.public int justifyV()
public void justifyV(int eNewJustifyV)
eNewJustifyV
- - New vertical justification.public boolean justifyVEnable()
public void justifyVEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the vertical justification is to be
enabled; FALSE if it is to be disabled.public int justifyH()
public void justifyH(int eNewJustifyH)
eNewJustifyH
- - New horizontal justification.public boolean justifyHEnable()
public void justifyHEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the horizontal justification is to be enabled;
FALSE if it is to be disabled.public TextMeasurement radixOffset()
public void radixOffset(TextMeasurement oNewRadixOffset)
oNewRadixOffset
- - New radix offset value.public boolean radixOffsetEnable()
public void radixOffsetEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the radix offset value is to be enabled;
FALSE if it is to be disabled.public int radixPos()
public void radixPos(int nNewRadixPos)
nNewRadixPos
- - New radix position value.public boolean radixPosEnable()
public void radixPosEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the radix offset value is to be enabled;
FALSE if it is to be disabled.public TextTabList tabs()
public void tabs(TextTabList oNewTabs)
oNewTabs
- - New tab list.public boolean tabsEnable()
public void tabsEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the tab list is to be enabled; FALSE if
it is to be disabled.public TextMeasurement special()
public void special(TextMeasurement oNewSpecial)
oNewSpecial
- - New special first line handling value.public boolean specialEnable()
public void specialEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the special first line handling value is
to be enabled; FALSE if it is to be disabled.public TextMeasurement spaceBefore()
public void spaceBefore(TextMeasurement oNewSpaceBefore)
oNewSpaceBefore
- - New vertical space before paragraph value.public boolean spaceBeforeEnable()
public void spaceBeforeEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the vertical space before paragraph value
is to be enabled; FALSE if it is to be disabled.public TextMeasurement spaceAfter()
public void spaceAfter(TextMeasurement oNewSpaceAfter)
oNewSpaceAfter
- - New vertical space after paragraph value.public boolean spaceAfterEnable()
public void spaceAfterEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the vertical space after paragraph value
is to be enabled; FALSE if it is to be disabled.public boolean invisible()
public void invisible(boolean bNewInvisible)
bNewInvisible
- - New invisible flag.public boolean invisibleEnable()
public void invisibleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the invisible flag is to be enabled;
FALSE if it is to be disabled.public char invisChar()
public void invisChar(char cNewInvisChar)
cNewInvisChar
- - New invisible character.public boolean invisCharEnable()
public void invisCharEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the invisible character is to be enabled;
FALSE if it is to be disabled.public TextBaselineShift baselineShift()
public void baselineShift(TextBaselineShift oNewShift)
oNewShift
- - New baseline shift.public boolean baselineShiftEnable()
public void baselineShiftEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the baseline shift is to be enabled;
FALSE if it is to be disabled.public UnitSpan flattenMeasurement(TextMeasurement oMeasurement)
Given a text measurement, this method flattens it to an absolute unit span. If the given measurement repsents a length, its length value is returned unchanged. Otherwise, its relative value is flattened in the context of font instance if not null, or the font size otherwise.
oMeasurement
- - Measurement to be flattened.public boolean flatten()
This method flattens all relative values in the attribute. Potential relative values are those returned as TextMeasurement, as well as subscript and superscript baseline shifts. If the potentially relative values are all absolute, the method does nothing. Flattening a subscript or superscript baseline shift yields an absolute displacement, with a corresponding adjustment to the font size.
public TextAttr conditionalFlatten()
This method returns a new, flattened text attribute object. If flattening would have no effect, the method simply returns NULL. Otherwise it clones this object and flattens it. The font size must also be enabled and be non-zero for this method to do anything.
Note that the resulting attribute object caches a pointer to this object and assumes that it is reference counted. Therefore, the caller must employ reference counting on this object to ensure that it isn't deleted too soon.
public TextAttr getOriginalAttr()
If a client is processing layout, it will see flattened baseline shifts. If it wishes to work with the more abstract Subscript and Superscript designations, it can track the original attribute object through the return value of this method.
public String locale()
public void locale(String sNewLocale)
sNewLocale
- - New locale value.public boolean localeEnable()
public void localeEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the locale value is to be enabled; FALSE
if it is to be disabled.public String actualLocale()
The text attribute object may or may not actually specify a locale. This method returns a locale name that the caller can use. If the text attribute object specifies a locale (enabled and non-empty string), that value is returned. If locale is enabled but empty, the ambient locale is returned. If locale is disabled, the locale "en_US" is returned.
public String radixText()
Returns the radix text string (e.g., period in en_US) resolved by locale. Uses the value returned by ActualLocale() to obtain the locale that determines the radix text string.
public char radixChar()
AXTE currently supports radix alignment on a single character. This method simply returns the first character of the string returned by the RadixText() method.
public int digits()
public void digits(int eNewDigits)
public boolean digitsEnable()
public void digitsEnable(boolean bNewEnable)
public int direction()
Many characters (e.g., some punctuation, spaces) are directionally neutral, that is, their direction (LTR or RTL) is determined by context at render time. Some times this is inappropriate, for example, part numbers that include punctuation. This attribute value can force directionality to LTR or RTL for neutral characters.
public void direction(int eNewDirection)
Please see the description of the first overload for the purpose of this attribute. This method allows the caller to change the neutral character directionality.
eNewDirection
- - New directionality setting.public boolean directionEnable()
public void directionEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the neutral character direction value is
to be enabled; FALSE if it is to be disabled.public int paraDirection()
The paragraph direction determines the higher-level ordering of mixed direction runs. If neutral, it is gleaned from the locale. The paragraph direction is also used to set vertical writing.
public void paraDirection(int eNewDirection)
eNewDirection
- - New paragraph direction for this attribute
object.public boolean paraDirectionEnable()
public void paraDirectionEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the paragraph character direction value
is to be enabled; FALSE if it is to be disabled.public int layoutOrientation()
The layout orientation specifies horizontal or vertical writing. This is a paragraph-level attribute. Because orientation cannot change mid-frame, changes to orientation in rich text may not be honoured. Indeed, in the initial implementation, the orientation in effect at the start of the stream affects all frames for that stream.
public void layoutOrientation(int eNewLayoutOrientation)
For more information on layout orientation, see the first overload of this method name.
eNewLayoutOrientation
- - New orientation for this attribute object.public boolean layoutOrientationEnable()
public void layoutOrientationEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the layout orientation value is to be
enabled; FALSE if it is to be disabled.public int ligature()
For compatibility with other products and versions, there is some control over the application of ligatures. Currently, there are two levels: minimal for repeatable forms processing, and common for text documents with improved appearance.
public void ligature(int eNewLigature)
Please see the description of the first overload for the purpose of this attribute. This method allows the caller to change the ligature level.
eNewLigature
- - New ligature setting.public boolean ligatureEnable()
public void ligatureEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the ligature level is to be enabled;
FALSE if it is to be disabled.public TextMeasurement charSpacing()
The character spacing is added to each character's default spacing when laying out text.
public void charSpacing(TextMeasurement nNewCharSpacing)
Note that setting a value with this method implicitly enables the character spacing setting. For more information, see method CharSpacingEnable().
nNewCharSpacing
- - New character spacing value. Negative
values are allowed.public boolean charSpacingEnable()
If enabled, the value returned by CharSpacing() is valid. If not enabled, the character spacing is effectively unknown.
public void charSpacingEnable(boolean bNewEnable)
bNewEnable
- - True if the character spacing setting is to be
enabled; false if it is to be disabled. Enabling a previously
disabled setting causes it to have a default value (one).public TextMeasurement wordSpacing()
The word spacing is added to each internal space in a line when laying out text.
public void wordSpacing(TextMeasurement nNewWordSpacing)
Note that setting a value with this method implicitly enables the word spacing setting. For more information, see method WordSpacingEnable().
nNewWordSpacing
- - New word spacing value. Negative values are
invalid.public boolean wordSpacingEnable()
If enabled, the value returned by WordSpacing() is valid. If not enabled, the word spacing is effectively unknown.
public void wordSpacingEnable(boolean bNewEnable)
bNewEnable
- - True if the word spacing setting is to be
enabled; false if it is to be disabled. Enabling a previously
disabled setting causes it to have a default value (one).public boolean kerning()
public void kerning(boolean bNewKerning)
Note that setting a value with this method implicitly enables the kerning setting. For more information, see method KerningEnable().
bNewKerning
- - New kerning value. True to enable kerning;
false to disable it.public boolean kerningEnable()
If enabled, the value returned by Kerning() is valid. If not enabled, the kerning is effectively unknown.
public void kerningEnable(boolean bNewEnable)
bNewEnable
- - True if the kerning setting is to be enabled;
false if it is to be disabled. Enabling a previously disabled
setting causes it to have a default value (false).public int hyphLevel()
public void hyphLevel(int eNewHyphLevel)
eNewHyphLevel
- - New hyphenation level.public boolean hyphLevelEnable()
public void hyphLevelEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation level is to be enabled;
FALSE if it is to be disabled.public int hyphMinWord()
public void hyphMinWord(int nNewHyphMinWord)
nNewHyphMinWord
- - New hyphenation minimum word size.public boolean hyphMinWordEnable()
public void hyphMinWordEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation minimum word size is to
be enabled; FALSE if it is to be disabled.public int hyphMinPrefix()
public void hyphMinPrefix(int nNewHyphMinPrefix)
nNewHyphMinPrefix
- - New hyphenation minimum prefix size.public boolean hyphMinPrefixEnable()
public void hyphMinPrefixEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation minimum prefix size is to
be enabled; FALSE if it is to be disabled.public int hyphMinSuffix()
public void hyphMinSuffix(int nNewHyphMinSuffix)
nNewHyphMinSuffix
- - New hyphenation minimum suffix size.public boolean hyphMinSuffixEnable()
public void hyphMinSuffixEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation minimum suffix size is to
be enabled; FALSE if it is to be disabled.public int hyphMaxLines()
public void hyphMaxLines(int nNewHyphMaxLines)
nNewHyphMaxLines
- - New maximum consecutive hyphenated lines.public boolean hyphMaxLinesEnable()
public void hyphMaxLinesEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the maximum consecutive hyphenated lines
is to be enabled; FALSE if it is to be disabled.public boolean hyphSuppressNames()
public void hyphSuppressNames(boolean bNewHyphSuppressNames)
bNewHyphSuppressNames
- - New hyphenation suppress formal names.public boolean hyphSuppressNamesEnable()
public void hyphSuppressNamesEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation suppress formal names is
to be enabled; FALSE if it is to be disabled.public boolean hyphSuppressAcronyms()
public void hyphSuppressAcronyms(boolean bNewHyphSuppressAcronyms)
bNewHyphSuppressAcronyms
- - New hyphenation suppress acronyms.public boolean hyphSuppressAcronymsEnable()
public void hyphSuppressAcronymsEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the hyphenation suppress acronyms is to
be enabled; FALSE if it is to be disabled.public int leaderPattern()
public void leaderPattern(int eNewLeaderPattern)
eNewLeaderPattern
- - New leader pattern value to use.public boolean leaderPatternEnable()
public void leaderPatternEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the leader pattern is to be enabled;
FALSE if it is to be disabled.public TextMeasurement leaderPatternWidth()
public void leaderPatternWidth(TextMeasurement oNewLeaderPatternWidth)
oNewLeaderPatternWidth
- - New leader pattern width value to
use.public boolean leaderPatternWidthEnable()
public void leaderPatternWidthEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the leader pattern width is to be
enabled; FALSE if it is to be disabled.public int leaderAlign()
public void leaderAlign(int eNewLeaderAlign)
eNewLeaderAlign
- - New leader alignment value to use.public boolean leaderAlignEnable()
public void leaderAlignEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the leader alignment is to be enabled;
FALSE if it is to be disabled.public TextStream leaderContent()
public void leaderContent(TextStream oNewLeaderContent)
oNewLeaderContent
- - New leader content value to use.public boolean leaderContentEnable()
public void leaderContentEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the leader content is to be enabled;
FALSE if it is to be disabled.public int ruleStyle()
public void ruleStyle(int eNewRuleStyle)
eNewRuleStyle
- - New rule style value to use.public boolean ruleStyleEnable()
public void ruleStyleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the rule style is to be enabled; FALSE if
it is to be disabled.public TextMeasurement ruleThickness()
public void ruleThickness(TextMeasurement oNewRuleThickness)
oNewRuleThickness
- - New rule thickness value to use.public boolean ruleThicknessEnable()
public void ruleThicknessEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the rule thickness is to be enabled;
FALSE if it is to be disabled.public double horizontalScale()
The horizontal scale is applied to the glyph X axis of the font, allowing glyphs to be stretched or shrunk in X independent of Y scaling.
public void horizontalScale(double nNewHorizontalScale)
nNewHorizontalScale
- - New Horizontal scale factor to apply to
font.public boolean horizontalScaleEnable()
public void horizontalScaleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the horizontal scale value is to be
enabled; FALSE if it is to be disabled.public double verticalScale()
The vertical scale is applied to the glyph Y axis of the font, allowing glyphs to be stretched or shrunk in Y independent of X scaling.
public void verticalScale(double nNewVerticalScale)
nNewVerticalScale
- - New vertical scale factor to apply to font.public boolean verticalScaleEnable()
public void verticalScaleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the vertical scale value is to be
enabled; FALSE if it is to be disabled.public void setDefault(boolean bDefault)
This method behaves like a Clear() or Reset() method might. It replaces all values in the text attribute object with defaults.
bDefault
- - FALSE if all attributes are to be disabled; TRUE if
they are to be enabled with default values.public void addDisabled(TextAttr oSource)
Copy candidate attributes from the source attribute object. An attribute is a candidate for copying if it is disabled in this object and enabled in the source.
oSource
- - Source atrributes for copy.public void override(TextAttr oOverride, TextAttr poDiffs)
Copy candidate attributes from the source attribute object. An attribute is a candidate for copying if it is enabled in the source. In other words, this method overrides attributes in this object, but will not override an enabled attribute with a disabled one.
oOverride
- - Source attributes for copy.poDiffs
- - (optional) Pointer to an attribute to receive just
the true differences. If NULL, the differences are not recorded
separately.public void override(TextAttr oOverride)
public void dropDiff(TextAttr oCompare)
Compare this object against another on an attribute by attribute basis. Where attribute values differ between the two objects, disable them in this object.
oCompare
- - Attribute object to compare against.public void dropSame(TextAttr oCompare, boolean bPreserveGfx)
Compare this object against another on an attribute by attribute basis. Where attribute values are the same between the two objects, disable them in this object.
oCompare
- - Attribute object to compare against.bPreserveGfx
- - (optional) If TRUE, don't drop the graphic text
attributes even if they are the same. If FALSE (default) don't give
graphic text attributes any special treatment.public void dropSame(TextAttr oCompare)
public void isolatePara(boolean bKeep, boolean bLegacyPositioning)
Isolate the paragraph attributes in this object either by disabling everything else or by disabling the paragraph attributes.
bKeep
- - (optional) If TRUE (default) paragraph attributes are
preserved and all others are disabled. If FALSE paragraph attributes
are disabled and all others are preserved.public void isolatePara(boolean bKeep)
public boolean isComplete()
public boolean isEmpty()
public boolean hasParaAttrs()
public static String formatPercent(double dRelative)
Given a relative value, this method returns a string representing that relative value formatted as a percentage. For example, if the relative value is 1.0, the result is "100%". Similarly, a relative value of 0.75 yields a result of "75%".
dRelative
- - Relative value to be formatted.public static double parsePercent(String sText, boolean bAllowNegative)
Given a string, this method parses it as a percentage and returns a relative value. For example, if the string is "120%", the result is 1.2. The percent sign is optional; if omitted, it is assumed. In other words, an input of "1.2" is assumed to mean 1.2% and yields a result of 0.012.
sText
- - Text string to parse.bAllowNegative
- - (optional) True to allow negative
percentages; false (default) to treat them as errors.public void copyFrom(TextAttr oSource)
The standard assignment copies everything, including enabled and disabled status. Graphic source information is also copied.
oSource
- - Source attribute object to copy.public boolean equals(Object object)
Compares on an attribute by attribute basis. Two attributes are considered equal if they are both disabled, or they are both enabled and their values compare for equality.
equals
in class TextGfxAttr
object
- Text attribute object to compare against.public int hashCode()
hashCode
in class TextGfxAttr
public boolean notEqual(TextAttr oCompare)
Compares on an attribute by attribute basis. Two attributes are considered unequal if their enabled/disabled settings don't match, or if they are both enabled and their values are unequal.
oCompare
- - Text attribute object to compare against.public static TextAttr defaultAttr(boolean bDefault)
Returns a reference to a pre-constructed text attribute object. The agttributes may all be disabled or they may all be set to default values.
bDefault
- - FALSE if attributes are to be disabled; TRUE if
they are to be enabled with default values.public void updateFont()
public void updateFont(com.adobe.xfa.text.TextAttr.FontDesc oNewFontDesc)
public void updateFont(FontInstance oNewFont, String sOriginalTypeface, boolean bUpdateOptional)
public void updateFont(FontInstance oNewFont, String sOriginalTypeface)
public void updateFont(TextAttr oSource)
public void debug()
public double getFloatValue(int nIndex)
public void setFloatValue(int nIndex, double nNewValue, boolean bEnable)
public void setFloatValue(int nIndex, double nNewValue)
public boolean isFloatEnabled(int nIndex)
public void enableFloat(int nIndex, boolean bEnable)
Copyright © 2010 - 2020 Adobe. All Rights Reserved