public class WordArea extends InlineArea
InlineArea.InlineAdjustingInfo
Modifier and Type | Field and Description |
---|---|
protected int[][] |
gposAdjustments
An array of glyph positioning adjustments to apply to each glyph 'char' in word (optional)
|
protected int[] |
letterAdjust
An array of width for adjusting the individual letters (optional)
|
protected int[] |
levels
An array of resolved bidirectional levels corresponding to each character
in word (optional)
|
protected boolean |
reversed
A flag indicating whether the content of word is reversed in relation to
its original logical order.
|
protected java.lang.String |
word
The text for this word area
|
adjustingInfo, blockProgressionOffset
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
extensionAttachments, foreignAttributes
Constructor and Description |
---|
WordArea(int blockProgressionOffset,
int level,
java.lang.String word,
int[] letterAdjust,
int[] levels,
int[][] gposAdjustments)
Create a word area
|
WordArea(int blockProgressionOffset,
int level,
java.lang.String word,
int[] letterAdjust,
int[] levels,
int[][] gposAdjustments,
boolean reversed)
Create a word area
|
Modifier and Type | Method and Description |
---|---|
int |
bidiLevelAt(int position)
Obtain per-character (glyph) level at a specified index position.
|
java.util.List |
collectInlineRuns(java.util.List runs)
Collection bidi inline runs.
|
int[] |
getBidiLevels()
Obtain per-character (glyph) bidi levels.
|
int[] |
getBidiLevels(int start,
int end)
Obtain per-character (glyph) bidi levels over a specified subsequence.
|
int[][] |
getGlyphPositionAdjustments()
Obtain per-character (glyph) position adjustments.
|
int[] |
getLetterAdjustArray() |
java.lang.String |
getWord() |
int[] |
glyphPositionAdjustmentsAt(int position)
Obtain per-character (glyph) position adjustments at a specified index position.
|
boolean |
isReversed()
Determined if word has been reversed (in relation to original logical order).
|
void |
mirror()
Perform mirroring on mirrorable characters.
|
void |
reverse(boolean mirror)
Reverse characters and corresponding per-character levels and glyph position
adjustments.
|
addChildArea, applyVariationFactor, getAdjustingInfo, getBlockProgressionOffset, getParentArea, handleIPDVariation, hasLineThrough, hasOverline, hasUnderline, increaseIPD, isAncestor, isAncestorOrSelf, isBlinking, notifyIPDVariation, setAdjustingInfo, setAdjustingInfo, setAdjustment, setBlockProgressionOffset, setParentArea
activateEffectiveIPD, addTrait, clone, getAllocBPD, getAllocIPD, getAreaClass, getBidiLevel, getBorderAndPaddingWidthAfter, getBorderAndPaddingWidthBefore, getBorderAndPaddingWidthEnd, getBorderAndPaddingWidthStart, getBPD, getEffectiveAllocIPD, getEffectiveIPD, getIPD, getSpaceAfter, getSpaceBefore, getSpaceEnd, getSpaceStart, getTrait, getTraitAsBoolean, getTraitAsInteger, getTraits, hasTrait, hasTraits, resetBidiLevel, setAreaClass, setBidiLevel, setBPD, setIPD, setTraits, setWritingModeTraits, toString
addExtensionAttachment, getExtensionAttachments, getForeignAttributes, getForeignAttributeValue, hasExtensionAttachments, setExtensionAttachments, setForeignAttribute, setForeignAttributes
protected java.lang.String word
protected int[] letterAdjust
protected int[] levels
protected int[][] gposAdjustments
protected boolean reversed
public WordArea(int blockProgressionOffset, int level, java.lang.String word, int[] letterAdjust, int[] levels, int[][] gposAdjustments, boolean reversed)
blockProgressionOffset
- the offset for this arealevel
- the bidirectional embedding level (or -1 if not defined) for word as a groupword
- the word stringletterAdjust
- the letter adjust array (may be null)levels
- array of per-character (glyph) bidirectional levels,
in case word area is heterogenously leveledgposAdjustments
- array of general position adjustments or null if none applyreversed
- true if word is known to be reversed at construction timepublic WordArea(int blockProgressionOffset, int level, java.lang.String word, int[] letterAdjust, int[] levels, int[][] gposAdjustments)
blockProgressionOffset
- the offset for this arealevel
- the bidirectional embedding level (or -1 if not defined) for word as a groupword
- the word stringletterAdjust
- the letter adjust array (may be null)levels
- array of per-character (glyph) bidirectional levels,
in case word area is heterogenously leveledgposAdjustments
- array of general position adjustments or null if none applypublic java.lang.String getWord()
public int[] getLetterAdjustArray()
public int[] getBidiLevels()
public int[] getBidiLevels(int start, int end)
Obtain per-character (glyph) bidi levels over a specified subsequence.
If word has been reversed, then the subsequence is over the reversed word.
start
- starting (inclusive) index of subsequenceend
- ending (exclusive) index of subsequencepublic int bidiLevelAt(int position)
Obtain per-character (glyph) level at a specified index position.
If word has been reversed, then the position is relative to the reversed word.
position
- the index of the (possibly reversed) character from which to obtain the
levelpublic java.util.List collectInlineRuns(java.util.List runs)
InlineArea
collectInlineRuns
in class InlineArea
runs
- current list of inline runspublic int[][] getGlyphPositionAdjustments()
public int[] glyphPositionAdjustmentsAt(int position)
Obtain per-character (glyph) position adjustments at a specified index position.
If word has been reversed, then the position is relative to the reversed word.
position
- the index of the (possibly reversed) character from which to obtain the
levelpublic void reverse(boolean mirror)
Reverse characters and corresponding per-character levels and glyph position adjustments.
mirror
- if true, then perform mirroring if mirrorred characterspublic void mirror()
Perform mirroring on mirrorable characters.
public boolean isReversed()
Determined if word has been reversed (in relation to original logical order).
If a word is reversed, then both its characters (glyphs) and corresponding per-character levels are in reverse order.
Note: this information is used in order to process non-spacing marks during rendering as well as provide hints for caret direction.
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.