Class TextAttr
- java.lang.Object
-
- com.adobe.xfa.text.TextGfxAttr
-
- com.adobe.xfa.text.TextAttr
-
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.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringactualLocale()Resolve the locale for the text attribute object.voidaddDisabled(TextAttr oSource)Partial copy, filling in disabled attributes.booleananyFontEnable()Query whether any of the font attributes is enabledTextBaselineShiftbaselineShift()Return the baseline shift if enabledvoidbaselineShift(TextBaselineShift oNewShift)Set and enable the baseline shiftbooleanbaselineShiftEnable()Query whether the baseline shift is enabledvoidbaselineShiftEnable(boolean bNewEnable)Enable/disable the baseline shiftTextMeasurementcharSpacing()Returns the character spacing setting for this text attribute object.voidcharSpacing(TextMeasurement nNewCharSpacing)Set a new character spacing value for this attribute object.booleancharSpacingEnable()Query whether the character spacing setting is enabled in this text attribute object.voidcharSpacingEnable(boolean bNewEnable)Enable or disable the character spacing setting in this attribute object.TextAttrconditionalFlatten()Perform flattening without affecting this object.voidcopyFrom(TextAttr oSource)Replace all attributes with those from the source object.voiddebug()static TextAttrdefaultAttr(boolean bDefault)Return a reference to a constant default text attribute object.intdigits()voiddigits(int eNewDigits)booleandigitsEnable()voiddigitsEnable(boolean bNewEnable)intdirection()Return the direction for neutral characters.voiddirection(int eNewDirection)Set the direction for neutral characters.booleandirectionEnable()Query whether the neutral character direction value is enabledvoiddirectionEnable(boolean bNewEnable)Enable/disable the neutral character direction valuevoiddropDiff(TextAttr oCompare)Disable attributes where different.voiddropSame(TextAttr oCompare)voiddropSame(TextAttr oCompare, boolean bPreserveGfx)Disable attributes where same.voidenableFloat(int nIndex, boolean bEnable)java.lang.Stringencoding()Return the encoding value if enabledvoidencoding(java.lang.String sNewEncoding)Set and enable the encoding valuebooleanencodingEnable()Query whether the encoding value is enabledvoidencodingEnable(boolean bNewEnable)Enable/disable the encoding valuebooleanequals(java.lang.Object object)Equality comparison operator.booleanflatten()Flatten relative measurements to absolute values.UnitSpanflattenMeasurement(TextMeasurement oMeasurement)Flatten a measurement in the context of this attribute.booleanfontEnable()Query whether the font value is enabledvoidfontEnable(boolean bNewEnable)Enable/disable the font valueFontInstancefontInstance()Return the font instance value if enabledvoidfontInstance(FontInstance oNewFont)voidfontInstance(FontInstance oNewFont, java.lang.String sOriginalTypeface)Set and enable the font instance valueFontServicefontService()Get a pointer to the FontService object used by this stream.voidfontService(FontService poNewFontService)voidfontService(FontService poNewFontService, boolean bSuppressReconcile)Set the FontService object used by this stream.static java.lang.StringformatPercent(double dRelative)Format a relative value as a percentage.doublegetFloatValue(int nIndex)TextAttrgetOriginalAttr()Return the original attribute object from one that has had its baseline shift flattened.TextGfxSourcegfxSource()Obtain graphic source information used by the stream.voidgfxSource(TextGfxSource oNewGfxSource)Change the graphic source used by the stream.GFXTextAttrgfxTextAttr()Query the collected graphic text attributesinthashCode()Returns a hash code value for the object.booleanhasParaAttrs()Determine whether any paragraph attribute is enableddoublehorizontalScale()Query the horizontal scale.voidhorizontalScale(double nNewHorizontalScale)Set the horizontal scale factor.booleanhorizontalScaleEnable()Query whether the horizontal scale value is enabledvoidhorizontalScaleEnable(boolean bNewEnable)Enable/disable the horizontal scale valueinthyphLevel()Return the hyphenation level if enabledvoidhyphLevel(int eNewHyphLevel)Set and enable the hyphenation levelbooleanhyphLevelEnable()Query whether the hyphenation level is enabledvoidhyphLevelEnable(boolean bNewEnable)Enable/disable the hyphenation levelinthyphMaxLines()Return the maximum consecutive hyphenated lines if enabledvoidhyphMaxLines(int nNewHyphMaxLines)Set and enable the hyphenation maximum consecutive hyphenated linesbooleanhyphMaxLinesEnable()Query whether the maximum consecutive hyphenated lines is enabledvoidhyphMaxLinesEnable(boolean bNewEnable)Enable/disable the hyphenation maximum consecutive hyphenated linesinthyphMinPrefix()Return the hyphenation minimum prefix size if enabledvoidhyphMinPrefix(int nNewHyphMinPrefix)Set and enable the hyphenation minimum prefix sizebooleanhyphMinPrefixEnable()Query whether the hyphenation minimum prefix size is enabledvoidhyphMinPrefixEnable(boolean bNewEnable)Enable/disable the hyphenation minimum prefix sizeinthyphMinSuffix()Return the hyphenation minimum suffix size if enabledvoidhyphMinSuffix(int nNewHyphMinSuffix)Set and enable the hyphenation minimum suffix sizebooleanhyphMinSuffixEnable()Query whether the hyphenation minimum suffix size is enabledvoidhyphMinSuffixEnable(boolean bNewEnable)Enable/disable the hyphenation minimum suffix sizeinthyphMinWord()Return the hyphenation minimum word size if enabledvoidhyphMinWord(int nNewHyphMinWord)Set and enable the hyphenation minimum word sizebooleanhyphMinWordEnable()Query whether the hyphenation minimum word size is enabledvoidhyphMinWordEnable(boolean bNewEnable)Enable/disable the hyphenation minimum word sizebooleanhyphSuppressAcronyms()Return the hyphenation suppress acronyms if enabledvoidhyphSuppressAcronyms(boolean bNewHyphSuppressAcronyms)Set and enable the hyphenation suppress acronymsbooleanhyphSuppressAcronymsEnable()Query whether the hyphenation suppress acronyms is enabledvoidhyphSuppressAcronymsEnable(boolean bNewEnable)Enable/disable the hyphenation suppress acronymsbooleanhyphSuppressNames()Return the hyphenation suppress formal names if enabledvoidhyphSuppressNames(boolean bNewHyphSuppressNames)Set and enable the hyphenation suppress formal namesbooleanhyphSuppressNamesEnable()Query whether the hyphenation suppress formal names is enabledvoidhyphSuppressNamesEnable(boolean bNewEnable)Enable/disable the hyphenation suppress formal namescharinvisChar()Return the invisible character if enabledvoidinvisChar(char cNewInvisChar)Set and enable the invisible characterbooleaninvisCharEnable()Query whether the invisible character is enabledvoidinvisCharEnable(boolean bNewEnable)Enable/disable the invisible characterbooleaninvisible()Return the invisible flag if enabledvoidinvisible(boolean bNewInvisible)Set and enable the invisible flagbooleaninvisibleEnable()Query whether the invisible flag is enabledvoidinvisibleEnable(boolean bNewEnable)Enable/disable the invisible flagbooleanisComplete()Determine whether all attributes are enabledbooleanisEmpty()Determine whether all attributes are disabledbooleanisFloatEnabled(int nIndex)voidisolatePara(boolean bKeep)voidisolatePara(boolean bKeep, boolean bLegacyPositioning)Isolate paragraph attributes.booleanitalic()Return the italic value if enabledvoiditalic(boolean bNewItalic)Set and enable the italic valuebooleanitalicEnable()Query whether the italic value is enabledvoiditalicEnable(boolean bNewEnable)Enable/disable the italic valueintjustifyH()Return the horizontal justification if enabledvoidjustifyH(int eNewJustifyH)Set and enable the horizontal justificationbooleanjustifyHEnable()Query whether the horizontal justification is enabledvoidjustifyHEnable(boolean bNewEnable)Enable/disable the horizontal justificationintjustifyV()Return the vertical justification if enabledvoidjustifyV(int eNewJustifyV)Set and enable the vertical justificationbooleanjustifyVEnable()Query whether the vertical justification is enabledvoidjustifyVEnable(boolean bNewEnable)Enable/disable the vertical justificationbooleankerning()Returns the kerning setting for this text attribute object.voidkerning(boolean bNewKerning)Set a new kerning value for this attribute object.booleankerningEnable()Query whether the kerning setting is enabled in this text attribute object.voidkerningEnable(boolean bNewEnable)Enable or disable the kerning setting in this attribute object.intlayoutOrientation()Return the layout orientation in effect.voidlayoutOrientation(int eNewLayoutOrientation)Set the layout orientation.booleanlayoutOrientationEnable()Query whether the layout orientation is enabled.voidlayoutOrientationEnable(boolean bNewEnable)Enable the layout orientation value.intleaderAlign()Retrieve the leader alignment currently in effect.voidleaderAlign(int eNewLeaderAlign)Change the leader alignment property in this attribute object.booleanleaderAlignEnable()Query whether the leader alignment is enabled.voidleaderAlignEnable(boolean bNewEnable)Enable/disable the leader alignment.TextStreamleaderContent()Retrieve the leader content currently in effect.voidleaderContent(TextStream oNewLeaderContent)Change the leader content property in this attribute object.booleanleaderContentEnable()Query whether the leader content is enabled.voidleaderContentEnable(boolean bNewEnable)Enable/disable the leader content.intleaderPattern()Retrieve the leader pattern currently in effect.voidleaderPattern(int eNewLeaderPattern)Change the leader pattern property in this attribute object.booleanleaderPatternEnable()Query whether the leader pattern is enabled.voidleaderPatternEnable(boolean bNewEnable)Enable/disable the leader pattern.TextMeasurementleaderPatternWidth()Retrieve the leader pattern width currently in effect.voidleaderPatternWidth(TextMeasurement oNewLeaderPatternWidth)Change the leader pattern width property in this attribute object.booleanleaderPatternWidthEnable()Query whether the leader pattern width is enabled.voidleaderPatternWidthEnable(boolean bNewEnable)Enable/disable the leader pattern width.intligature()Return the ligature level.voidligature(int eNewLigature)Set the ligature level.booleanligatureEnable()Query whether the ligature level is enabled.voidligatureEnable(boolean bNewEnable)Enable/disable the ligature level.java.lang.Stringlocale()Return the locale value if enabledvoidlocale(java.lang.String sNewLocale)Set and enable the locale valuebooleanlocaleEnable()Query whether the locale value is enabledvoidlocaleEnable(boolean bNewEnable)Enable/disable the locale valueTextMeasurementmarginL()Return the left margin if enabledvoidmarginL(TextMeasurement oNewMarginL)Set and enable the left marginbooleanmarginLEnable()Query whether the left margin is enabledvoidmarginLEnable(boolean bNewEnable)Enable/disable the left marginTextMeasurementmarginR()Return the right margin if enabledvoidmarginR(TextMeasurement oNewMarginR)Set and enable the right marginbooleanmarginREnable()Query whether the right margin is enabledvoidmarginREnable(boolean bNewEnable)Enable/disable the right marginstatic booleanmatch(TextAttr poAttr1, TextAttr poAttr2)booleannotEqual(TextAttr oCompare)Inequality comparison operator.java.lang.StringoriginalTypeface()Return the OriginalTypeface valuevoidoverride(TextAttr oOverride)voidoverride(TextAttr oOverride, TextAttr poDiffs)Partial copy, selecting enabled attributes in the source.intparaDirection()Return the paragraph direction.voidparaDirection(int eNewDirection)Change the paragraph direction.booleanparaDirectionEnable()Query whether the paragraph character direction value is enabled.voidparaDirectionEnable(boolean bNewEnable)Enable/disable the paragraph character direction value.static doubleparsePercent(java.lang.String sText, boolean bAllowNegative)Parse a persentage string to get a relative value.charradixChar()Return the radix character, resolved by locale.TextMeasurementradixOffset()Return the radix offset value if enabledvoidradixOffset(TextMeasurement oNewRadixOffset)Set and enable the radix offset valuebooleanradixOffsetEnable()Query whether the radix offset value is enabledvoidradixOffsetEnable(boolean bNewEnable)Enable/disable the radix offset valueintradixPos()Get the radix position valuevoidradixPos(int nNewRadixPos)Set the radix position valuebooleanradixPosEnable()Query whether the radix position value is enabledvoidradixPosEnable(boolean bNewEnable)Enable/disable the radix position valuejava.lang.StringradixText()Return the radix text string, resolved by locale.intruleStyle()Retrieve the rule style currently in effect.voidruleStyle(int eNewRuleStyle)Change the rule style property in this attribute object.booleanruleStyleEnable()Query whether the rule style is enabled.voidruleStyleEnable(boolean bNewEnable)Enable/disable the rule style.TextMeasurementruleThickness()Retrieve the rule thickness currently in effect.voidruleThickness(TextMeasurement oNewRuleThickness)Change the rule thickness property in this attribute object.booleanruleThicknessEnable()Query whether the rule thickness is enabled.voidruleThicknessEnable(boolean bNewEnable)Enable/disable the rule thickness.voidsetDefault(boolean bDefault)Fill the text attribute holder with default values.voidsetFloatValue(int nIndex, double nNewValue)voidsetFloatValue(int nIndex, double nNewValue, boolean bEnable)UnitSpansize()Return the size value if enabledvoidsize(UnitSpan oNewSize)Set and enable the size valuebooleansizeEnable()Query whether the size value is enabledvoidsizeEnable(boolean bNewEnable)Enable/disable the size valueTextMeasurementspaceAfter()Return the vertical space after paragraph value if enabledvoidspaceAfter(TextMeasurement oNewSpaceAfter)Set and enable the vertical space after paragraph valuebooleanspaceAfterEnable()Query whether the vertical space after paragraph value is enabledvoidspaceAfterEnable(boolean bNewEnable)Enable/disable the vertical space after paragraph valueTextMeasurementspaceBefore()Return the vertical space before paragraph value if enabledvoidspaceBefore(TextMeasurement oNewSpaceBefore)Set and enable the vertical space before paragraph valuebooleanspaceBeforeEnable()Query whether the vertical space before paragraph value is enabledvoidspaceBeforeEnable(boolean bNewEnable)Enable/disable the vertical space before paragraph valueTextMeasurementspacing()Return the line spacing if enabledvoidspacing(TextMeasurement oNewSpacing)Set and enable the line spacingbooleanspacingEnable()Query whether the line spacing is enabledvoidspacingEnable(boolean bNewEnable)Enable/disable the line spacingTextMeasurementspecial()Return the special first line handling value if enabledvoidspecial(TextMeasurement oNewSpecial)Set and enable the special first line handling valuebooleanspecialEnable()Query whether the special first line handling value is enabledvoidspecialEnable(boolean bNewEnable)Enable/disable the special first line handling valuebooleansubstituteFont()Return if the font instance is a substitute fontTextTabListtabs()Return the tab list if enabledvoidtabs(TextTabList oNewTabs)Set and enable the tab listbooleantabsEnable()Query whether the tab list is enabledvoidtabsEnable(boolean bNewEnable)Enable/disable the tab listbooleantransparent()Return the transparent flag if enabledvoidtransparent(boolean bNewTransparent)Set and enable the transparent flagbooleantransparentEnable()Query whether the transparent flag is enabledvoidtransparentEnable(boolean bNewEnable)Enable/disable the transparent flagjava.lang.Stringtypeface()Return the Typeface value if enabledvoidtypeface(java.lang.String sNewTypeface)Set and enable the typeface valuevoidtypeface(java.lang.String sNewTypeface, int nWeight, boolean bItalic, java.lang.String sEncoding)Set and enable the typeface valuevoidtypeface(java.lang.String sNewTypeface, UnitSpan oSize, int nWeight, int nItalic)Set and enable one or more of typeface, size, weight and italic.booleantypefaceEnable()Query whether the typeface value is enabledvoidtypefaceEnable(boolean bNewEnable)Enable/disable the typeface valuevoidupdateFont()voidupdateFont(FontInstance oNewFont, java.lang.String sOriginalTypeface)voidupdateFont(FontInstance oNewFont, java.lang.String sOriginalTypeface, boolean bUpdateOptional)voidupdateFont(TextAttr oSource)voidupdateFont(com.adobe.xfa.text.TextAttr.FontDesc oNewFontDesc)doubleverticalScale()Query the Vertical scale.voidverticalScale(double nNewVerticalScale)Set the vertical scale factor.booleanverticalScaleEnable()Query whether the vertical scale value is enabledvoidverticalScaleEnable(boolean bNewEnable)Enable/disable the vertical scale valueintweight()Return the weight value if enabledvoidweight(int iNewWeight)Set and enable the weight valuebooleanweightEnable()Query whether the weight value is enabledvoidweightEnable(boolean bNewEnable)Enable/disable the weight valueTextMeasurementwordSpacing()Returns the word spacing setting for this text attribute object.voidwordSpacing(TextMeasurement nNewWordSpacing)Set a new word spacing value for this attribute object.booleanwordSpacingEnable()Query whether the word spacing setting is enabled in this text attribute object.voidwordSpacingEnable(boolean bNewEnable)Enable or disable the word spacing setting in this attribute object.-
Methods inherited from class com.adobe.xfa.text.TextGfxAttr
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
-
-
-
-
Field Detail
-
JUST_V_UNKNOWN
public static final int JUST_V_UNKNOWN
- See Also:
- Constant Field Values
-
JUST_V_TOP
public static final int JUST_V_TOP
- See Also:
- Constant Field Values
-
JUST_V_MIDDLE
public static final int JUST_V_MIDDLE
- See Also:
- Constant Field Values
-
JUST_V_BOTTOM
public static final int JUST_V_BOTTOM
- See Also:
- Constant Field Values
-
JUST_H_UNKNOWN
public static final int JUST_H_UNKNOWN
- See Also:
- Constant Field Values
-
JUST_H_LEFT
public static final int JUST_H_LEFT
- See Also:
- Constant Field Values
-
JUST_H_CENTRE
public static final int JUST_H_CENTRE
- See Also:
- Constant Field Values
-
JUST_H_RIGHT
public static final int JUST_H_RIGHT
- See Also:
- Constant Field Values
-
JUST_H_SPREAD
public static final int JUST_H_SPREAD
- See Also:
- Constant Field Values
-
JUST_H_SPREAD_ALL
public static final int JUST_H_SPREAD_ALL
- See Also:
- Constant Field Values
-
JUST_H_RADIX
public static final int JUST_H_RADIX
- See Also:
- Constant Field Values
-
JUST_H_COMB_LEFT
public static final int JUST_H_COMB_LEFT
- See Also:
- Constant Field Values
-
JUST_H_COMB_CENTRE
public static final int JUST_H_COMB_CENTRE
- See Also:
- Constant Field Values
-
JUST_H_COMB_RIGHT
public static final int JUST_H_COMB_RIGHT
- See Also:
- Constant Field Values
-
DIGITS_LOCALE
public static final int DIGITS_LOCALE
- See Also:
- Constant Field Values
-
DIGITS_ARABIC
public static final int DIGITS_ARABIC
- See Also:
- Constant Field Values
-
DIGITS_INDIC
public static final int DIGITS_INDIC
- See Also:
- Constant Field Values
-
DIRECTION_NEUTRAL
public static final int DIRECTION_NEUTRAL
- See Also:
- Constant Field Values
-
DIRECTION_LTR
public static final int DIRECTION_LTR
- See Also:
- Constant Field Values
-
DIRECTION_RTL
public static final int DIRECTION_RTL
- See Also:
- Constant Field Values
-
ORIENTATION_HORIZONTAL
public static final int ORIENTATION_HORIZONTAL
- See Also:
- Constant Field Values
-
ORIENTATION_VERTICAL_LTR
public static final int ORIENTATION_VERTICAL_LTR
- See Also:
- Constant Field Values
-
ORIENTATION_VERTICAL_RTL
public static final int ORIENTATION_VERTICAL_RTL
- See Also:
- Constant Field Values
-
LIGATURE_MINIMUM
public static final int LIGATURE_MINIMUM
- See Also:
- Constant Field Values
-
LIGATURE_COMMON
public static final int LIGATURE_COMMON
- See Also:
- Constant Field Values
-
HYPHEN_OFF
public static final int HYPHEN_OFF
- See Also:
- Constant Field Values
-
HYPHEN_PREFERRED
public static final int HYPHEN_PREFERRED
- See Also:
- Constant Field Values
-
HYPHEN_NORMAL
public static final int HYPHEN_NORMAL
- See Also:
- Constant Field Values
-
HYPHEN_ALL
public static final int HYPHEN_ALL
- See Also:
- Constant Field Values
-
LEADER_PATTERN_SPACE
public static final int LEADER_PATTERN_SPACE
- See Also:
- Constant Field Values
-
LEADER_PATTERN_RULE
public static final int LEADER_PATTERN_RULE
- See Also:
- Constant Field Values
-
LEADER_PATTERN_DOTS
public static final int LEADER_PATTERN_DOTS
- See Also:
- Constant Field Values
-
LEADER_PATTERN_USE_CONTENT
public static final int LEADER_PATTERN_USE_CONTENT
- See Also:
- Constant Field Values
-
LEADER_ALIGN_NONE
public static final int LEADER_ALIGN_NONE
- See Also:
- Constant Field Values
-
LEADER_ALIGN_PAGE
public static final int LEADER_ALIGN_PAGE
- See Also:
- Constant Field Values
-
RULE_STYLE_NONE
public static final int RULE_STYLE_NONE
- See Also:
- Constant Field Values
-
RULE_STYLE_SOLID
public static final int RULE_STYLE_SOLID
- See Also:
- Constant Field Values
-
RULE_STYLE_DOTTED
public static final int RULE_STYLE_DOTTED
- See Also:
- Constant Field Values
-
RULE_STYLE_DASHED
public static final int RULE_STYLE_DASHED
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_LEVEL
public static final int DEFAULT_HYPH_LEVEL
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_MIN_WORD
public static final int DEFAULT_HYPH_MIN_WORD
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_MIN_PREFIX
public static final int DEFAULT_HYPH_MIN_PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_MIN_SUFFIX
public static final int DEFAULT_HYPH_MIN_SUFFIX
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_MAX_LINES
public static final int DEFAULT_HYPH_MAX_LINES
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_SUPPRESS_NAMES
public static final boolean DEFAULT_HYPH_SUPPRESS_NAMES
- See Also:
- Constant Field Values
-
DEFAULT_HYPH_SUPPRESS_ACRONYMS
public static final boolean DEFAULT_HYPH_SUPPRESS_ACRONYMS
- See Also:
- Constant Field Values
-
DEFAULT_LEADER_PATTERN
public static final int DEFAULT_LEADER_PATTERN
- See Also:
- Constant Field Values
-
DEFAULT_LEADER_ALIGN
public static final int DEFAULT_LEADER_ALIGN
- See Also:
- Constant Field Values
-
DEFAULT_RULE_STYLE
public static final int DEFAULT_RULE_STYLE
- See Also:
- Constant Field Values
-
defaultFull
public static final TextAttr defaultFull
-
defaultEmpty
public static final TextAttr defaultEmpty
-
-
Constructor Detail
-
TextAttr
public TextAttr()
Default constructor.Populates the text attribute object with all attributes disabled.
-
TextAttr
public TextAttr(boolean bDefault)
Constructor with control over defaulting technique.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.
- Parameters:
bDefault- - FALSE if attributes are to be disabled; TRUE if they are to be enabled with default values.
-
TextAttr
public TextAttr(TextAttr oSource)
Copy constructor.Copies all attributes and their enabled/disabled status. This also copies the graphic source connection of the source attribute object.
- Parameters:
oSource- - Source attribute object to copy.
-
TextAttr
public TextAttr(TextAttr oSource, TextGfxSource oGfxSource)
Copy constructor with graphic source.Copies all attributes and their enabled/disabled status, but reestablishes them in the context of a different graphic source.
- Parameters:
oSource- - Source attribute object to copy.oGfxSource- - Graphic source to use for the copy.
-
-
Method Detail
-
gfxSource
public TextGfxSource gfxSource()
Obtain graphic source information used by the stream.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.
- Returns:
- Constant reference to the text stream's graphic source
-
gfxSource
public void gfxSource(TextGfxSource oNewGfxSource)
Change the graphic source used by the stream.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.
- Parameters:
oNewGfxSource- - New graphic source to use for the object.
-
fontService
public FontService fontService()
Get a pointer to the FontService object used by this stream.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.
- Returns:
- Pointer to the font service currently in use. May be NULL.
-
fontService
public void fontService(FontService poNewFontService, boolean bSuppressReconcile)
Set the FontService object used by this stream.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.
- Parameters:
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.
-
fontService
public void fontService(FontService poNewFontService)
-
fontInstance
public FontInstance fontInstance()
Return the font instance value if enabled- Returns:
- FontInstance value. NULL if not enabled.
-
fontInstance
public void fontInstance(FontInstance oNewFont, java.lang.String sOriginalTypeface)
Set and enable the font instance value- Parameters:
oNewFont- - New font instance value. Note: setting the font instance value to a NULL pointer disables it.sOriginalTypeface- - Original typeface value for substituted fonts.
-
fontInstance
public void fontInstance(FontInstance oNewFont)
-
substituteFont
public boolean substituteFont()
Return if the font instance is a substitute font
-
fontEnable
public boolean fontEnable()
Query whether the font value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
fontEnable
public void fontEnable(boolean bNewEnable)
Enable/disable the font value- Parameters:
bNewEnable- - TRUE if the font value is to be enabled; FALSE if it is to be disabled.
-
anyFontEnable
public boolean anyFontEnable()
Query whether any of the font attributes is enabled- Returns:
- TRUE if any of typeface, size, weight or italic is enabled; FALSE if all disabled.
-
typeface
public java.lang.String typeface()
Return the Typeface value if enabled- Returns:
- Typeface value.
-
typeface
public void typeface(java.lang.String sNewTypeface, int nWeight, boolean bItalic, java.lang.String sEncoding)Set and enable the typeface value- Parameters:
sNewTypeface- - New typeface value.nWeight- - bold attribute.bItalic- - Italicize.
-
typeface
public void typeface(java.lang.String sNewTypeface)
Set and enable the typeface value- Parameters:
sNewTypeface- - New typeface value.
-
typeface
public void typeface(java.lang.String sNewTypeface, UnitSpan oSize, int nWeight, int nItalic)Set and enable one or more of typeface, size, weight and italic. NOTE: This method will not set the corresponding attributes if the parameters are empty or zero.- Parameters:
sNewTypeface- - New typeface value.oSize- - New size value.nWeight- - New weight value.nItalic- - New italic value.
-
typefaceEnable
public boolean typefaceEnable()
Query whether the typeface value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
typefaceEnable
public void typefaceEnable(boolean bNewEnable)
Enable/disable the typeface value- Parameters:
bNewEnable- - TRUE if the typeface value is to be enabled; FALSE if it is to be disabled.
-
originalTypeface
public java.lang.String originalTypeface()
Return the OriginalTypeface value- Returns:
- OriginalTypeface value.
-
encoding
public java.lang.String encoding()
Return the encoding value if enabled- Returns:
- Encoding value.
-
encoding
public void encoding(java.lang.String sNewEncoding)
Set and enable the encoding value- Parameters:
sNewEncoding- - New encoding value.
-
encodingEnable
public boolean encodingEnable()
Query whether the encoding value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
encodingEnable
public void encodingEnable(boolean bNewEnable)
Enable/disable the encoding value- Parameters:
bNewEnable- - TRUE if the encoding value is to be enabled; FALSE if it is to be disabled.
-
size
public UnitSpan size()
Return the size value if enabled- Returns:
- Size value.
-
size
public void size(UnitSpan oNewSize)
Set and enable the size value- Parameters:
oNewSize- - New size value.
-
sizeEnable
public boolean sizeEnable()
Query whether the size value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
sizeEnable
public void sizeEnable(boolean bNewEnable)
Enable/disable the size value- Parameters:
bNewEnable- - TRUE if the size value is to be enabled; FALSE if it is to be disabled.
-
weight
public int weight()
Return the weight value if enabled- Returns:
- Weight value.
-
weight
public void weight(int iNewWeight)
Set and enable the weight value- Parameters:
iNewWeight- - New weight value.
-
weightEnable
public boolean weightEnable()
Query whether the weight value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
weightEnable
public void weightEnable(boolean bNewEnable)
Enable/disable the weight value- Parameters:
bNewEnable- - TRUE if the weight value is to be enabled; FALSE if it is to be disabled.
-
italic
public boolean italic()
Return the italic value if enabled- Returns:
- Italic value.
-
italic
public void italic(boolean bNewItalic)
Set and enable the italic value- Parameters:
bNewItalic- - New italic value.
-
italicEnable
public boolean italicEnable()
Query whether the italic value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
italicEnable
public void italicEnable(boolean bNewEnable)
Enable/disable the italic value- Parameters:
bNewEnable- - TRUE if the italic value is to be enabled; FALSE if it is to be disabled.
-
gfxTextAttr
public GFXTextAttr gfxTextAttr()
Query the collected graphic text attributes- Returns:
- - The collected graphic text attributes (GfxTextAttr) represented in this object.
-
transparent
public boolean transparent()
Return the transparent flag if enabled- Returns:
- Transparent flag.
-
transparent
public void transparent(boolean bNewTransparent)
Set and enable the transparent flag- Parameters:
bNewTransparent- - New transparent flag.
-
transparentEnable
public boolean transparentEnable()
Query whether the transparent flag is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
transparentEnable
public void transparentEnable(boolean bNewEnable)
Enable/disable the transparent flag- Parameters:
bNewEnable- - TRUE if the transparent flag is to be enabled; FALSE if it is to be disabled.
-
spacing
public TextMeasurement spacing()
Return the line spacing if enabled- Returns:
- Line spacing.
-
spacing
public void spacing(TextMeasurement oNewSpacing)
Set and enable the line spacing- Parameters:
oNewSpacing- - New line spacing.
-
spacingEnable
public boolean spacingEnable()
Query whether the line spacing is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
spacingEnable
public void spacingEnable(boolean bNewEnable)
Enable/disable the line spacing- Parameters:
bNewEnable- - TRUE if the line spacing is to be enabled; FALSE if it is to be disabled.
-
marginL
public TextMeasurement marginL()
Return the left margin if enabled- Returns:
- Left margin.
-
marginL
public void marginL(TextMeasurement oNewMarginL)
Set and enable the left margin- Parameters:
oNewMarginL- - New left margin.
-
marginLEnable
public boolean marginLEnable()
Query whether the left margin is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
marginLEnable
public void marginLEnable(boolean bNewEnable)
Enable/disable the left margin- Parameters:
bNewEnable- - TRUE if the left margin is to be enabled; FALSE if it is to be disabled.
-
marginR
public TextMeasurement marginR()
Return the right margin if enabled- Returns:
- Right margin.
-
marginR
public void marginR(TextMeasurement oNewMarginR)
Set and enable the right margin- Parameters:
oNewMarginR- - New right margin.
-
marginREnable
public boolean marginREnable()
Query whether the right margin is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
marginREnable
public void marginREnable(boolean bNewEnable)
Enable/disable the right margin- Parameters:
bNewEnable- - TRUE if the right margin is to be enabled; FALSE if it is to be disabled.
-
justifyV
public int justifyV()
Return the vertical justification if enabled- Returns:
- vertical justification.
-
justifyV
public void justifyV(int eNewJustifyV)
Set and enable the vertical justification- Parameters:
eNewJustifyV- - New vertical justification.
-
justifyVEnable
public boolean justifyVEnable()
Query whether the vertical justification is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
justifyVEnable
public void justifyVEnable(boolean bNewEnable)
Enable/disable the vertical justification- Parameters:
bNewEnable- - TRUE if the vertical justification is to be enabled; FALSE if it is to be disabled.
-
justifyH
public int justifyH()
Return the horizontal justification if enabled- Returns:
- Horizontal justification.
-
justifyH
public void justifyH(int eNewJustifyH)
Set and enable the horizontal justification- Parameters:
eNewJustifyH- - New horizontal justification.
-
justifyHEnable
public boolean justifyHEnable()
Query whether the horizontal justification is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
justifyHEnable
public void justifyHEnable(boolean bNewEnable)
Enable/disable the horizontal justification- Parameters:
bNewEnable- - TRUE if the horizontal justification is to be enabled; FALSE if it is to be disabled.
-
radixOffset
public TextMeasurement radixOffset()
Return the radix offset value if enabled- Returns:
- Radix offset value.
-
radixOffset
public void radixOffset(TextMeasurement oNewRadixOffset)
Set and enable the radix offset value- Parameters:
oNewRadixOffset- - New radix offset value.
-
radixOffsetEnable
public boolean radixOffsetEnable()
Query whether the radix offset value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
radixOffsetEnable
public void radixOffsetEnable(boolean bNewEnable)
Enable/disable the radix offset value- Parameters:
bNewEnable- - TRUE if the radix offset value is to be enabled; FALSE if it is to be disabled.
-
radixPos
public int radixPos()
Get the radix position value- Returns:
- the radix position value.
-
radixPos
public void radixPos(int nNewRadixPos)
Set the radix position value- Parameters:
nNewRadixPos- - New radix position value.
-
radixPosEnable
public boolean radixPosEnable()
Query whether the radix position value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
radixPosEnable
public void radixPosEnable(boolean bNewEnable)
Enable/disable the radix position value- Parameters:
bNewEnable- - TRUE if the radix offset value is to be enabled; FALSE if it is to be disabled.
-
tabs
public TextTabList tabs()
Return the tab list if enabled- Returns:
- tab list.
-
tabs
public void tabs(TextTabList oNewTabs)
Set and enable the tab list- Parameters:
oNewTabs- - New tab list.
-
tabsEnable
public boolean tabsEnable()
Query whether the tab list is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
tabsEnable
public void tabsEnable(boolean bNewEnable)
Enable/disable the tab list- Parameters:
bNewEnable- - TRUE if the tab list is to be enabled; FALSE if it is to be disabled.
-
special
public TextMeasurement special()
Return the special first line handling value if enabled- Returns:
- Special first line handling value.
-
special
public void special(TextMeasurement oNewSpecial)
Set and enable the special first line handling value- Parameters:
oNewSpecial- - New special first line handling value.
-
specialEnable
public boolean specialEnable()
Query whether the special first line handling value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
specialEnable
public void specialEnable(boolean bNewEnable)
Enable/disable the special first line handling value- Parameters:
bNewEnable- - TRUE if the special first line handling value is to be enabled; FALSE if it is to be disabled.
-
spaceBefore
public TextMeasurement spaceBefore()
Return the vertical space before paragraph value if enabled- Returns:
- Vertical space before paragraph.
-
spaceBefore
public void spaceBefore(TextMeasurement oNewSpaceBefore)
Set and enable the vertical space before paragraph value- Parameters:
oNewSpaceBefore- - New vertical space before paragraph value.
-
spaceBeforeEnable
public boolean spaceBeforeEnable()
Query whether the vertical space before paragraph value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
spaceBeforeEnable
public void spaceBeforeEnable(boolean bNewEnable)
Enable/disable the vertical space before paragraph value- Parameters:
bNewEnable- - TRUE if the vertical space before paragraph value is to be enabled; FALSE if it is to be disabled.
-
spaceAfter
public TextMeasurement spaceAfter()
Return the vertical space after paragraph value if enabled- Returns:
- Vertical space after paragraph value.
-
spaceAfter
public void spaceAfter(TextMeasurement oNewSpaceAfter)
Set and enable the vertical space after paragraph value- Parameters:
oNewSpaceAfter- - New vertical space after paragraph value.
-
spaceAfterEnable
public boolean spaceAfterEnable()
Query whether the vertical space after paragraph value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
spaceAfterEnable
public void spaceAfterEnable(boolean bNewEnable)
Enable/disable the vertical space after paragraph value- Parameters:
bNewEnable- - TRUE if the vertical space after paragraph value is to be enabled; FALSE if it is to be disabled.
-
invisible
public boolean invisible()
Return the invisible flag if enabled- Returns:
- Invisible flag.
-
invisible
public void invisible(boolean bNewInvisible)
Set and enable the invisible flag- Parameters:
bNewInvisible- - New invisible flag.
-
invisibleEnable
public boolean invisibleEnable()
Query whether the invisible flag is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
invisibleEnable
public void invisibleEnable(boolean bNewEnable)
Enable/disable the invisible flag- Parameters:
bNewEnable- - TRUE if the invisible flag is to be enabled; FALSE if it is to be disabled.
-
invisChar
public char invisChar()
Return the invisible character if enabled- Returns:
- Invisible character.
-
invisChar
public void invisChar(char cNewInvisChar)
Set and enable the invisible character- Parameters:
cNewInvisChar- - New invisible character.
-
invisCharEnable
public boolean invisCharEnable()
Query whether the invisible character is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
invisCharEnable
public void invisCharEnable(boolean bNewEnable)
Enable/disable the invisible character- Parameters:
bNewEnable- - TRUE if the invisible character is to be enabled; FALSE if it is to be disabled.
-
baselineShift
public TextBaselineShift baselineShift()
Return the baseline shift if enabled- Returns:
- Baseline shift.
-
baselineShift
public void baselineShift(TextBaselineShift oNewShift)
Set and enable the baseline shift- Parameters:
oNewShift- - New baseline shift.
-
baselineShiftEnable
public boolean baselineShiftEnable()
Query whether the baseline shift is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
baselineShiftEnable
public void baselineShiftEnable(boolean bNewEnable)
Enable/disable the baseline shift- Parameters:
bNewEnable- - TRUE if the baseline shift is to be enabled; FALSE if it is to be disabled.
-
flattenMeasurement
public UnitSpan flattenMeasurement(TextMeasurement oMeasurement)
Flatten a measurement in the context of this attribute.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.
- Parameters:
oMeasurement- - Measurement to be flattened.- Returns:
- The flattened value.
-
flatten
public boolean flatten()
Flatten relative measurements to absolute values.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.
- Returns:
- - True if any change took place; false if this object is unaltered.
-
conditionalFlatten
public TextAttr conditionalFlatten()
Perform flattening without affecting this object.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.
- Returns:
- NULL if no flattening took place, or a new flattened text attribute object. with flattened baseline shift.
-
getOriginalAttr
public TextAttr getOriginalAttr()
Return the original attribute object from one that has had its baseline shift flattened.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.
- Returns:
- Pointer to original attribute object if this object is the result of flattening a baseline shift; NULL otherwise.
-
locale
public java.lang.String locale()
Return the locale value if enabled- Returns:
- Locale value.
-
locale
public void locale(java.lang.String sNewLocale)
Set and enable the locale value- Parameters:
sNewLocale- - New locale value.
-
localeEnable
public boolean localeEnable()
Query whether the locale value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
localeEnable
public void localeEnable(boolean bNewEnable)
Enable/disable the locale value- Parameters:
bNewEnable- - TRUE if the locale value is to be enabled; FALSE if it is to be disabled.
-
actualLocale
public java.lang.String actualLocale()
Resolve the locale for the text attribute object.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.
- Returns:
- Actual locale string.
-
radixText
public java.lang.String radixText()
Return the radix text string, resolved by locale.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.
- Returns:
- Radix text string.
-
radixChar
public char radixChar()
Return the radix character, resolved by locale.AXTE currently supports radix alignment on a single character. This method simply returns the first character of the string returned by the RadixText() method.
- Returns:
- Radix character.
-
digits
public int digits()
-
digits
public void digits(int eNewDigits)
-
digitsEnable
public boolean digitsEnable()
-
digitsEnable
public void digitsEnable(boolean bNewEnable)
-
direction
public int direction()
Return the direction for neutral characters.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.
- Returns:
- Current neutral character directionality setting.
-
direction
public void direction(int eNewDirection)
Set the direction for neutral characters.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.
- Parameters:
eNewDirection- - New directionality setting.
-
directionEnable
public boolean directionEnable()
Query whether the neutral character direction value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
directionEnable
public void directionEnable(boolean bNewEnable)
Enable/disable the neutral character direction value- Parameters:
bNewEnable- - TRUE if the neutral character direction value is to be enabled; FALSE if it is to be disabled.
-
paraDirection
public int paraDirection()
Return the paragraph direction.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.
- Returns:
- Current paragraph direction in effect.
-
paraDirection
public void paraDirection(int eNewDirection)
Change the paragraph direction.- Parameters:
eNewDirection- - New paragraph direction for this attribute object.
-
paraDirectionEnable
public boolean paraDirectionEnable()
Query whether the paragraph character direction value is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
paraDirectionEnable
public void paraDirectionEnable(boolean bNewEnable)
Enable/disable the paragraph character direction value.- Parameters:
bNewEnable- - TRUE if the paragraph character direction value is to be enabled; FALSE if it is to be disabled.
-
layoutOrientation
public int layoutOrientation()
Return the layout orientation in effect.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.
- Returns:
- Layout orientation. Default is horizontal.
-
layoutOrientation
public void layoutOrientation(int eNewLayoutOrientation)
Set the layout orientation.For more information on layout orientation, see the first overload of this method name.
- Parameters:
eNewLayoutOrientation- - New orientation for this attribute object.
-
layoutOrientationEnable
public boolean layoutOrientationEnable()
Query whether the layout orientation is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
layoutOrientationEnable
public void layoutOrientationEnable(boolean bNewEnable)
Enable the layout orientation value.- Parameters:
bNewEnable- - TRUE if the layout orientation value is to be enabled; FALSE if it is to be disabled.
-
ligature
public int ligature()
Return the ligature level.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.
- Returns:
- Current ligature level.
-
ligature
public void ligature(int eNewLigature)
Set the ligature level.Please see the description of the first overload for the purpose of this attribute. This method allows the caller to change the ligature level.
- Parameters:
eNewLigature- - New ligature setting.
-
ligatureEnable
public boolean ligatureEnable()
Query whether the ligature level is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
ligatureEnable
public void ligatureEnable(boolean bNewEnable)
Enable/disable the ligature level.- Parameters:
bNewEnable- - TRUE if the ligature level is to be enabled; FALSE if it is to be disabled.
-
charSpacing
public TextMeasurement charSpacing()
Returns the character spacing setting for this text attribute object.The character spacing is added to each character's default spacing when laying out text.
- Returns:
- Character spacing value currently in effect for this attribute object. The default value is zero.
-
charSpacing
public void charSpacing(TextMeasurement nNewCharSpacing)
Set a new character spacing value for this attribute object.Note that setting a value with this method implicitly enables the character spacing setting. For more information, see method CharSpacingEnable().
- Parameters:
nNewCharSpacing- - New character spacing value. Negative values are allowed.
-
charSpacingEnable
public boolean charSpacingEnable()
Query whether the character spacing setting is enabled in this text attribute object.If enabled, the value returned by CharSpacing() is valid. If not enabled, the character spacing is effectively unknown.
- Returns:
- True if character spacing is currently enabled; false if not.
-
charSpacingEnable
public void charSpacingEnable(boolean bNewEnable)
Enable or disable the character spacing setting in this attribute object.- Parameters:
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).
-
wordSpacing
public TextMeasurement wordSpacing()
Returns the word spacing setting for this text attribute object.The word spacing is added to each internal space in a line when laying out text.
- Returns:
- Word spacing value currently in effect for this attribute object. The default value is zero.
-
wordSpacing
public void wordSpacing(TextMeasurement nNewWordSpacing)
Set a new word spacing value for this attribute object.Note that setting a value with this method implicitly enables the word spacing setting. For more information, see method WordSpacingEnable().
- Parameters:
nNewWordSpacing- - New word spacing value. Negative values are invalid.
-
wordSpacingEnable
public boolean wordSpacingEnable()
Query whether the word spacing setting is enabled in this text attribute object.If enabled, the value returned by WordSpacing() is valid. If not enabled, the word spacing is effectively unknown.
- Returns:
- True if word spacing is currently enabled; false if not.
-
wordSpacingEnable
public void wordSpacingEnable(boolean bNewEnable)
Enable or disable the word spacing setting in this attribute object.- Parameters:
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).
-
kerning
public boolean kerning()
Returns the kerning setting for this text attribute object.- Returns:
- Indicates whether kerning is currently in effect for this attribute object. The default value is false.
-
kerning
public void kerning(boolean bNewKerning)
Set a new kerning value for this attribute object.Note that setting a value with this method implicitly enables the kerning setting. For more information, see method KerningEnable().
- Parameters:
bNewKerning- - New kerning value. True to enable kerning; false to disable it.
-
kerningEnable
public boolean kerningEnable()
Query whether the kerning setting is enabled in this text attribute object.If enabled, the value returned by Kerning() is valid. If not enabled, the kerning is effectively unknown.
- Returns:
- True if kerning is currently enabled; false if not.
-
kerningEnable
public void kerningEnable(boolean bNewEnable)
Enable or disable the kerning setting in this attribute object.- Parameters:
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).
-
hyphLevel
public int hyphLevel()
Return the hyphenation level if enabled- Returns:
- Hyphenation level.
-
hyphLevel
public void hyphLevel(int eNewHyphLevel)
Set and enable the hyphenation level- Parameters:
eNewHyphLevel- - New hyphenation level.
-
hyphLevelEnable
public boolean hyphLevelEnable()
Query whether the hyphenation level is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphLevelEnable
public void hyphLevelEnable(boolean bNewEnable)
Enable/disable the hyphenation level- Parameters:
bNewEnable- - TRUE if the hyphenation level is to be enabled; FALSE if it is to be disabled.
-
hyphMinWord
public int hyphMinWord()
Return the hyphenation minimum word size if enabled- Returns:
- Hyphenation minimum word size.
-
hyphMinWord
public void hyphMinWord(int nNewHyphMinWord)
Set and enable the hyphenation minimum word size- Parameters:
nNewHyphMinWord- - New hyphenation minimum word size.
-
hyphMinWordEnable
public boolean hyphMinWordEnable()
Query whether the hyphenation minimum word size is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphMinWordEnable
public void hyphMinWordEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum word size- Parameters:
bNewEnable- - TRUE if the hyphenation minimum word size is to be enabled; FALSE if it is to be disabled.
-
hyphMinPrefix
public int hyphMinPrefix()
Return the hyphenation minimum prefix size if enabled- Returns:
- Hyphenation minimum prefix size.
-
hyphMinPrefix
public void hyphMinPrefix(int nNewHyphMinPrefix)
Set and enable the hyphenation minimum prefix size- Parameters:
nNewHyphMinPrefix- - New hyphenation minimum prefix size.
-
hyphMinPrefixEnable
public boolean hyphMinPrefixEnable()
Query whether the hyphenation minimum prefix size is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphMinPrefixEnable
public void hyphMinPrefixEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum prefix size- Parameters:
bNewEnable- - TRUE if the hyphenation minimum prefix size is to be enabled; FALSE if it is to be disabled.
-
hyphMinSuffix
public int hyphMinSuffix()
Return the hyphenation minimum suffix size if enabled- Returns:
- Hyphenation minimum suffix size.
-
hyphMinSuffix
public void hyphMinSuffix(int nNewHyphMinSuffix)
Set and enable the hyphenation minimum suffix size- Parameters:
nNewHyphMinSuffix- - New hyphenation minimum suffix size.
-
hyphMinSuffixEnable
public boolean hyphMinSuffixEnable()
Query whether the hyphenation minimum suffix size is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphMinSuffixEnable
public void hyphMinSuffixEnable(boolean bNewEnable)
Enable/disable the hyphenation minimum suffix size- Parameters:
bNewEnable- - TRUE if the hyphenation minimum suffix size is to be enabled; FALSE if it is to be disabled.
-
hyphMaxLines
public int hyphMaxLines()
Return the maximum consecutive hyphenated lines if enabled- Returns:
- Maximum consecutive hyphenated lines.
-
hyphMaxLines
public void hyphMaxLines(int nNewHyphMaxLines)
Set and enable the hyphenation maximum consecutive hyphenated lines- Parameters:
nNewHyphMaxLines- - New maximum consecutive hyphenated lines.
-
hyphMaxLinesEnable
public boolean hyphMaxLinesEnable()
Query whether the maximum consecutive hyphenated lines is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphMaxLinesEnable
public void hyphMaxLinesEnable(boolean bNewEnable)
Enable/disable the hyphenation maximum consecutive hyphenated lines- Parameters:
bNewEnable- - TRUE if the maximum consecutive hyphenated lines is to be enabled; FALSE if it is to be disabled.
-
hyphSuppressNames
public boolean hyphSuppressNames()
Return the hyphenation suppress formal names if enabled- Returns:
- Hyphenation suppress formal names.
-
hyphSuppressNames
public void hyphSuppressNames(boolean bNewHyphSuppressNames)
Set and enable the hyphenation suppress formal names- Parameters:
bNewHyphSuppressNames- - New hyphenation suppress formal names.
-
hyphSuppressNamesEnable
public boolean hyphSuppressNamesEnable()
Query whether the hyphenation suppress formal names is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphSuppressNamesEnable
public void hyphSuppressNamesEnable(boolean bNewEnable)
Enable/disable the hyphenation suppress formal names- Parameters:
bNewEnable- - TRUE if the hyphenation suppress formal names is to be enabled; FALSE if it is to be disabled.
-
hyphSuppressAcronyms
public boolean hyphSuppressAcronyms()
Return the hyphenation suppress acronyms if enabled- Returns:
- Hyphenation suppress acronyms.
-
hyphSuppressAcronyms
public void hyphSuppressAcronyms(boolean bNewHyphSuppressAcronyms)
Set and enable the hyphenation suppress acronyms- Parameters:
bNewHyphSuppressAcronyms- - New hyphenation suppress acronyms.
-
hyphSuppressAcronymsEnable
public boolean hyphSuppressAcronymsEnable()
Query whether the hyphenation suppress acronyms is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
hyphSuppressAcronymsEnable
public void hyphSuppressAcronymsEnable(boolean bNewEnable)
Enable/disable the hyphenation suppress acronyms- Parameters:
bNewEnable- - TRUE if the hyphenation suppress acronyms is to be enabled; FALSE if it is to be disabled.
-
leaderPattern
public int leaderPattern()
Retrieve the leader pattern currently in effect.- Returns:
- Leader pattern code describing how to render tab leaders.
-
leaderPattern
public void leaderPattern(int eNewLeaderPattern)
Change the leader pattern property in this attribute object.- Parameters:
eNewLeaderPattern- - New leader pattern value to use.
-
leaderPatternEnable
public boolean leaderPatternEnable()
Query whether the leader pattern is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
leaderPatternEnable
public void leaderPatternEnable(boolean bNewEnable)
Enable/disable the leader pattern.- Parameters:
bNewEnable- - TRUE if the leader pattern is to be enabled; FALSE if it is to be disabled.
-
leaderPatternWidth
public TextMeasurement leaderPatternWidth()
Retrieve the leader pattern width currently in effect.- Returns:
- Leader pattern width code describing how to render tab leaders.
-
leaderPatternWidth
public void leaderPatternWidth(TextMeasurement oNewLeaderPatternWidth)
Change the leader pattern width property in this attribute object.- Parameters:
oNewLeaderPatternWidth- - New leader pattern width value to use.
-
leaderPatternWidthEnable
public boolean leaderPatternWidthEnable()
Query whether the leader pattern width is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
leaderPatternWidthEnable
public void leaderPatternWidthEnable(boolean bNewEnable)
Enable/disable the leader pattern width.- Parameters:
bNewEnable- - TRUE if the leader pattern width is to be enabled; FALSE if it is to be disabled.
-
leaderAlign
public int leaderAlign()
Retrieve the leader alignment currently in effect.- Returns:
- Leader alignment code describing how to render tab leaders.
-
leaderAlign
public void leaderAlign(int eNewLeaderAlign)
Change the leader alignment property in this attribute object.- Parameters:
eNewLeaderAlign- - New leader alignment value to use.
-
leaderAlignEnable
public boolean leaderAlignEnable()
Query whether the leader alignment is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
leaderAlignEnable
public void leaderAlignEnable(boolean bNewEnable)
Enable/disable the leader alignment.- Parameters:
bNewEnable- - TRUE if the leader alignment is to be enabled; FALSE if it is to be disabled.
-
leaderContent
public TextStream leaderContent()
Retrieve the leader content currently in effect.- Returns:
- Leader content code describing how to render tab leaders.
-
leaderContent
public void leaderContent(TextStream oNewLeaderContent)
Change the leader content property in this attribute object.- Parameters:
oNewLeaderContent- - New leader content value to use.
-
leaderContentEnable
public boolean leaderContentEnable()
Query whether the leader content is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
leaderContentEnable
public void leaderContentEnable(boolean bNewEnable)
Enable/disable the leader content.- Parameters:
bNewEnable- - TRUE if the leader content is to be enabled; FALSE if it is to be disabled.
-
ruleStyle
public int ruleStyle()
Retrieve the rule style currently in effect.- Returns:
- Rule style code describing how to render tab leaders.
-
ruleStyle
public void ruleStyle(int eNewRuleStyle)
Change the rule style property in this attribute object.- Parameters:
eNewRuleStyle- - New rule style value to use.
-
ruleStyleEnable
public boolean ruleStyleEnable()
Query whether the rule style is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
ruleStyleEnable
public void ruleStyleEnable(boolean bNewEnable)
Enable/disable the rule style.- Parameters:
bNewEnable- - TRUE if the rule style is to be enabled; FALSE if it is to be disabled.
-
ruleThickness
public TextMeasurement ruleThickness()
Retrieve the rule thickness currently in effect.- Returns:
- Rule thickness code describing how to render tab leaders.
-
ruleThickness
public void ruleThickness(TextMeasurement oNewRuleThickness)
Change the rule thickness property in this attribute object.- Parameters:
oNewRuleThickness- - New rule thickness value to use.
-
ruleThicknessEnable
public boolean ruleThicknessEnable()
Query whether the rule thickness is enabled.- Returns:
- TRUE if enabled; FALSE if not.
-
ruleThicknessEnable
public void ruleThicknessEnable(boolean bNewEnable)
Enable/disable the rule thickness.- Parameters:
bNewEnable- - TRUE if the rule thickness is to be enabled; FALSE if it is to be disabled.
-
horizontalScale
public double horizontalScale()
Query the horizontal scale.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.
- Returns:
- Horizontal scale factor. Default is 1.0.
-
horizontalScale
public void horizontalScale(double nNewHorizontalScale)
Set the horizontal scale factor.- Parameters:
nNewHorizontalScale- - New Horizontal scale factor to apply to font.
-
horizontalScaleEnable
public boolean horizontalScaleEnable()
Query whether the horizontal scale value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
horizontalScaleEnable
public void horizontalScaleEnable(boolean bNewEnable)
Enable/disable the horizontal scale value- Parameters:
bNewEnable- - TRUE if the horizontal scale value is to be enabled; FALSE if it is to be disabled.
-
verticalScale
public double verticalScale()
Query the Vertical scale.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.
- Returns:
- Vertical scale factor. Default is 1.0.
-
verticalScale
public void verticalScale(double nNewVerticalScale)
Set the vertical scale factor.- Parameters:
nNewVerticalScale- - New vertical scale factor to apply to font.
-
verticalScaleEnable
public boolean verticalScaleEnable()
Query whether the vertical scale value is enabled- Returns:
- TRUE if enabled; FALSE if not.
-
verticalScaleEnable
public void verticalScaleEnable(boolean bNewEnable)
Enable/disable the vertical scale value- Parameters:
bNewEnable- - TRUE if the vertical scale value is to be enabled; FALSE if it is to be disabled.
-
setDefault
public void setDefault(boolean bDefault)
Fill the text attribute holder with default values.This method behaves like a Clear() or Reset() method might. It replaces all values in the text attribute object with defaults.
- Parameters:
bDefault- - FALSE if all attributes are to be disabled; TRUE if they are to be enabled with default values.
-
addDisabled
public void addDisabled(TextAttr oSource)
Partial copy, filling in disabled attributes.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.
- Parameters:
oSource- - Source atrributes for copy.
-
override
public void override(TextAttr oOverride, TextAttr poDiffs)
Partial copy, selecting enabled attributes in the source.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.
- Parameters:
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.
-
override
public void override(TextAttr oOverride)
-
dropDiff
public void dropDiff(TextAttr oCompare)
Disable attributes where different.Compare this object against another on an attribute by attribute basis. Where attribute values differ between the two objects, disable them in this object.
- Parameters:
oCompare- - Attribute object to compare against.
-
dropSame
public void dropSame(TextAttr oCompare, boolean bPreserveGfx)
Disable attributes where same.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.
- Parameters:
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.
-
dropSame
public void dropSame(TextAttr oCompare)
-
isolatePara
public void isolatePara(boolean bKeep, boolean bLegacyPositioning)Isolate paragraph attributes.Isolate the paragraph attributes in this object either by disabling everything else or by disabling the paragraph attributes.
- Parameters:
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.
-
isolatePara
public void isolatePara(boolean bKeep)
-
isComplete
public boolean isComplete()
Determine whether all attributes are enabled- Returns:
- TRUE if all attributes are enabled; FALSE if any attribute is disabled.
-
isEmpty
public boolean isEmpty()
Determine whether all attributes are disabled- Returns:
- TRUE if all attributes are disabled; FALSE if any attribute is enabled.
-
hasParaAttrs
public boolean hasParaAttrs()
Determine whether any paragraph attribute is enabled- Returns:
- TRUE if any paragraph attribute is enabled; FALSE if all paragraph attributes are disabled.
-
formatPercent
public static java.lang.String formatPercent(double dRelative)
Format a relative value as a percentage.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%".
- Parameters:
dRelative- - Relative value to be formatted.- Returns:
- String result, as described above.
-
parsePercent
public static double parsePercent(java.lang.String sText, boolean bAllowNegative)Parse a persentage string to get a relative value.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.
- Parameters:
sText- - Text string to parse.bAllowNegative- - (optional) True to allow negative percentages; false (default) to treat them as errors.- Returns:
- True if the parse succeeded; false if an error occurred.
-
copyFrom
public void copyFrom(TextAttr oSource)
Replace all attributes with those from the source object.The standard assignment copies everything, including enabled and disabled status. Graphic source information is also copied.
- Parameters:
oSource- - Source attribute object to copy.
-
equals
public boolean equals(java.lang.Object object)
Equality comparison operator.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.
- Overrides:
equalsin classTextGfxAttr- Parameters:
object- Text attribute object to compare against.- Returns:
- TRUE if the text attribute objects are considered equal; FALSE otherwise.
-
hashCode
public int hashCode()
Returns a hash code value for the object. This method is unsupported.- Overrides:
hashCodein classTextGfxAttr
-
notEqual
public boolean notEqual(TextAttr oCompare)
Inequality comparison operator.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.
- Parameters:
oCompare- - Text attribute object to compare against.- Returns:
- TRUE if the text attribute objects are considered not equal; FALSE otherwise.
-
defaultAttr
public static TextAttr defaultAttr(boolean bDefault)
Return a reference to a constant default text attribute object.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.
- Parameters:
bDefault- - FALSE if attributes are to be disabled; TRUE if they are to be enabled with default values.- Returns:
- Reference to the default text attribute object.
-
updateFont
public void updateFont()
-
updateFont
public void updateFont(com.adobe.xfa.text.TextAttr.FontDesc oNewFontDesc)
-
updateFont
public void updateFont(FontInstance oNewFont, java.lang.String sOriginalTypeface, boolean bUpdateOptional)
-
updateFont
public void updateFont(FontInstance oNewFont, java.lang.String sOriginalTypeface)
-
updateFont
public void updateFont(TextAttr oSource)
-
debug
public void debug()
-
getFloatValue
public double getFloatValue(int nIndex)
-
setFloatValue
public void setFloatValue(int nIndex, double nNewValue, boolean bEnable)
-
setFloatValue
public void setFloatValue(int nIndex, double nNewValue)
-
isFloatEnabled
public boolean isFloatEnabled(int nIndex)
-
enableFloat
public void enableFloat(int nIndex, boolean bEnable)
-
-