Package com.openhtmltopdf.bidi
Class SimpleBidiSplitter
- java.lang.Object
-
- com.openhtmltopdf.bidi.SimpleBidiSplitter
-
- All Implemented Interfaces:
BidiSplitter
public class SimpleBidiSplitter extends Object implements BidiSplitter
-
-
Field Summary
-
Fields inherited from interface com.openhtmltopdf.bidi.BidiSplitter
LTR, NEUTRAL, RTL
-
-
Constructor Summary
Constructors Constructor Description SimpleBidiSplitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountTextRuns()Count the number of runs, each of which contains text in one visual order only.bytegetBaseDirection(String paragraph)Get the base direction of a paragraph.BidiTextRungetVisualRun(int runIndex)voidsetParagraph(String paragraph, byte defaultDirection)Sets the text which is to be split on visual ordering.
-
-
-
Method Detail
-
setParagraph
public void setParagraph(String paragraph, byte defaultDirection)
Description copied from interface:BidiSplitterSets the text which is to be split on visual ordering.- Specified by:
setParagraphin interfaceBidiSplitterdefaultDirection- either LTR or RTL
-
countTextRuns
public int countTextRuns()
Description copied from interface:BidiSplitterCount 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:
countTextRunsin interfaceBidiSplitter
-
getVisualRun
public BidiTextRun getVisualRun(int runIndex)
- Specified by:
getVisualRunin interfaceBidiSplitter- Parameters:
runIndex- from zero to countTextRuns.- Returns:
- information about a visual run.
-
getBaseDirection
public byte getBaseDirection(String paragraph)
Description copied from interface:BidiSplitterGet 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:
getBaseDirectionin interfaceBidiSplitter
-
-