Package com.openhtmltopdf.bidi
Class SimpleBidiSplitter
java.lang.Object
com.openhtmltopdf.bidi.SimpleBidiSplitter
- All Implemented Interfaces:
BidiSplitter
-
Field Summary
FieldsFields inherited from interface com.openhtmltopdf.bidi.BidiSplitter
LTR, NEUTRAL, RTL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Count the number of runs, each of which contains text in one visual order only.byte
getBaseDirection
(String paragraph) Get the base direction of a paragraph.getVisualRun
(int runIndex) void
setParagraph
(String paragraph, byte defaultDirection) Sets the text which is to be split on visual ordering.
-
Field Details
-
runs
-
-
Constructor Details
-
SimpleBidiSplitter
public SimpleBidiSplitter()
-
-
Method Details
-
setParagraph
Description copied from interface:BidiSplitter
Sets the text which is to be split on visual ordering.- Specified by:
setParagraph
in interfaceBidiSplitter
- Parameters:
paragraph
-defaultDirection
- either LTR or RTL
-
countTextRuns
public int countTextRuns()Description copied from interface:BidiSplitter
Count the number of runs, each of which contains text in one visual order only. Can only be called after setParagraph has run the BIDI algorithm.- Specified by:
countTextRuns
in interfaceBidiSplitter
-
getVisualRun
- Specified by:
getVisualRun
in interfaceBidiSplitter
- Parameters:
runIndex
- from zero to countTextRuns.- Returns:
- information about a visual run.
-
getBaseDirection
Description copied from interface:BidiSplitter
Get the base direction of a paragraph. Defined as the first character that has strong directionality or neutral if they are all neutral characters.- Specified by:
getBaseDirection
in interfaceBidiSplitter
-