Package org.apache.fop.area.inline
Class TextArea
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ResolvedPageNumber
,UnresolvedPageNumber
A text inline area.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.fop.area.inline.AbstractTextArea
AbstractTextArea.TextAdjustingInfo
Nested classes/interfaces inherited from class org.apache.fop.area.inline.InlineArea
InlineArea.InlineAdjustingInfo
-
Field Summary
Fields inherited from class org.apache.fop.area.inline.InlineParent
autoSize, inlines, minChildOffset
Fields inherited from class org.apache.fop.area.inline.InlineArea
adjustingInfo, blockProgressionOffset
Fields inherited from class org.apache.fop.area.Area
bidiLevel, bpd, CLASS_ABSOLUTE, CLASS_BEFORE_FLOAT, CLASS_FIXED, CLASS_FOOTNOTE, CLASS_MAX, CLASS_NORMAL, CLASS_SIDE_FLOAT, effectiveIPD, ipd, log, ORIENT_0, ORIENT_180, ORIENT_270, ORIENT_90, traits
Fields inherited from class org.apache.fop.area.AreaTreeObject
extensionAttachments, foreignAttributes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSpace
(char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) Create and add a SpaceArea child to this TextAreavoid
Create and add a WordArea child to this TextArea.void
Create and add a WordArea child to this TextArea.void
addWord
(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset) void
addWord
(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset, boolean nextIsSpace) Create and add a WordArea child to this TextArea.int
getText()
Get the whole text string.boolean
Returnstrue
if the last word in this area is hyphenated.void
Remove the old textvoid
Records that the last word in this text area is hyphenated.toString()
void
updateLevel
(int newLevel) Methods inherited from class org.apache.fop.area.inline.AbstractTextArea
applyVariationFactor, getBaselineOffset, getTextLetterSpaceAdjust, getTextWordSpaceAdjust, setBaselineOffset, setSpaceDifference, setTextLetterSpaceAdjust, setTextWordSpaceAdjust
Methods inherited from class org.apache.fop.area.inline.InlineParent
addChildArea, collectInlineRuns, getChildAreas, resetChildrenLevel
Methods inherited from class org.apache.fop.area.inline.InlineArea
getAdjustingInfo, getBlockProgressionOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isAncestor, isAncestorOrSelf, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustingInfo, setAdjustment, setBlockProgressionOffset, setParentArea
Methods inherited from class org.apache.fop.area.Area
activateEffectiveIPD, addTrait, clone, getAllocBPD, getAllocIPD, getAreaClass, getBidiLevel, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getBPD, getChangeBarList, getEffectiveAllocIPD, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsBoolean, getTraitAsInteger, getTraits, hasTrait, hasTraits, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setChangeBarList, setIPD, setTraits, setWritingModeTraits
Methods inherited from class org.apache.fop.area.AreaTreeObject
addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributes
-
Constructor Details
-
TextArea
public TextArea()Create a text inline area -
TextArea
public TextArea(int stretch, int shrink, int adj) Constructor with extra parameters: create a TextAdjustingInfo object- Parameters:
stretch
- the available stretch of the textshrink
- the available shrink of the textadj
- the current total adjustment
-
-
Method Details
-
removeText
public void removeText()Remove the old text -
addWord
Create and add a WordArea child to this TextArea.- Parameters:
word
- the word stringoffset
- the offset for the next area
-
addWord
Create and add a WordArea child to this TextArea.- Parameters:
word
- the word stringoffset
- the offset for the next arealevel
- bidirectional level that applies to entire word
-
addWord
public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset, boolean nextIsSpace) Create and add a WordArea child to this TextArea.- Parameters:
word
- the word stringipd
- the word's ipdletterAdjust
- the letter adjustment array (may be null)levels
- array of resolved bidirectional levels of word characters, or null if default levelgposAdjustments
- array of general position adjustments or null if none applyblockProgressionOffset
- the offset for the next area
-
addWord
public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset) -
addSpace
public void addSpace(char space, int ipd, boolean adjustable, int blockProgressionOffset, int level) Create and add a SpaceArea child to this TextArea- Parameters:
space
- the space characteripd
- the space's ipdblockProgressionOffset
- the offset for the next areaadjustable
- is this space adjustable?level
- resolved bidirection level of space character
-
setHyphenated
public void setHyphenated()Records that the last word in this text area is hyphenated. -
isHyphenated
public boolean isHyphenated()Returnstrue
if the last word in this area is hyphenated. -
getText
Get the whole text string. Renderers whose space adjustment handling is not affected by multi-byte characters can use this method to render the whole TextArea at once; the other renderers (for example PDFRenderer) have to implement renderWord(WordArea) and renderSpace(SpaceArea) in order to correctly place each text fragment.- Returns:
- the text string
-
toString
-
updateLevel
public void updateLevel(int newLevel) -
getEffectiveIPD
public int getEffectiveIPD()- Overrides:
getEffectiveIPD
in classArea
-