java.lang.Object
org.sejda.sambox.util.BidiUtils
see http://translationtherapy.com/understanding-how-to-work-with-bi-directionality-bidi-text/ and
https://docs.oracle.com/javase/tutorial/2d/text/textlayoutbidirectionaltext.html for some info related to BiDi
contents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidparseBidiFile(InputStream inputStream) This method parses the bidi file provided as inputstream.static StringvisualToLogical(String text) Handles the LTR and RTL direction of the given words.
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
MIRRORING_CHAR_MAP
-
-
Constructor Details
-
BidiUtils
private BidiUtils()
-
-
Method Details
-
visualToLogical
Handles the LTR and RTL direction of the given words. The whole implementation stands and falls with the given word. If the word is a full line, the results will be the best. If the word contains of single words or characters, the order of the characters in a word or words in a line may wrong, due to RTL and LTR marks and characters! Based on http://www.nesterovsky-bros.com/weblog/2013/07/28/VisualToLogicalConversionInJava.aspx- Parameters:
text- The word that shall be processed- Returns:
- new word with the correct direction of the containing characters
-
parseBidiFile
This method parses the bidi file provided as inputstream.- Parameters:
inputStream- - The bidi file as inputstream- Throws:
IOException- if any line could not be read by the LineNumberReader
-