Class BidiUtils

java.lang.Object
org.sejda.sambox.util.BidiUtils

public final class BidiUtils extends Object
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
Author:
Andrea Vacondio
  • Method Details

    • visualToLogical

      public static String visualToLogical(String text)
      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