Package com.openhtmltopdf.bidi
Class ParagraphSplitter.Paragraph
java.lang.Object
com.openhtmltopdf.bidi.ParagraphSplitter.Paragraph
- Direct Known Subclasses:
ParagraphSplitter.FakeParagraph
- Enclosing class:
ParagraphSplitter
A paragraph object collects the text of one paragraph.
That is the text in a block element wiht possible holes from BIDI isolation tags.
This text is then used to run the Unicode BIDI algorithm splitting text
up into runs of LTR and RTL text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte
private final StringBuilder
protected final IdentValue
private final TreeMap
<Integer, BidiTextRun> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Paragraph
(IdentValue direction) private
Paragraph
(IdentValue direction, boolean isLiveImplementation) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Here we add a textnode and its postion to a list.private void
copySplitPointsFromBidiSplitter
(BidiSplitter splitter) Here we copy the split points from the BIDI processor to our tree map for easy access.byte
int
nextSplit
(int startIndexInParagraph) prevSplit
(int startIndexInParagraph) protected void
runBidiSplitter
(BidiSplitter splitter, LayoutContext c) Here we call out to the actual BIDI algorithm.
-
Field Details
-
builder
-
splitPoints
-
textRuns
-
cssDirection
-
actualDirection
private byte actualDirection
-
-
Constructor Details
-
Paragraph
-
Paragraph
-
-
Method Details
-
add
Here we add a textnode and its postion to a list. We also build the paragraph string. -
runBidiSplitter
Here we call out to the actual BIDI algorithm. -
getFirstCharIndexInParagraph
- Returns:
- the first char index into this paragraph from a Text node or -1 if not available.
-
copySplitPointsFromBidiSplitter
Here we copy the split points from the BIDI processor to our tree map for easy access. -
nextSplit
- Returns:
- the BidiTextRun that starts at or above startIndexInPararagraph.
-
prevSplit
- Returns:
- the BidiTextRun that starts at or before startIndexInParagraph.
-
getActualDirection
public byte getActualDirection() -
getCSSDirection
-