title: how to detect a different language in itext using java?
body: <p>The user enters his details in a registration form.So the user can enter either in english or arabic.My requirement is if he enters arabic i need to detect that and set the font and direction to RTL.IF its english it shud display as it is.I know how to set the font.But i dont know how to set the direction for the string.It should change direction for arabic only.</p>
  
  <pre><code>BaseFont bf = BaseFont.createFont("C:\\WINDOWS\\Fonts\\ARIALUNI.TTF",BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
  Font font = new Font(bf, 10, 0);
  String arab="آزمايش";
  document.add(new Chunk(arab, font));
  </code></pre>
  
  <p>The above code writes the arabic text in the pdf in reverse. How do i set the direction for that string?So in short my requirement is to write the string value correctly if its english from LTR ,if its arabic from RTL.Could some1 help me with this?Thanks.</p>