I have read a number of messages regarding Arabic text, and I cannot read
Arabic, so cannot verify my opinion, but it looks like the 
http://itext.ugent.be/library/com/lowagie/examples/directcontent/graphics2D/ArabicText.java
sample  posted on lowagie.com does not render in the correct direction,
though it does solve issues with the DefaultFontMapper lacking a Unicode
font.

According to the book, when using PDFGraphics2D, iText doesn't handle RTL
text and may make mistakes with ligatures.  This can be corrected by using
createGraphicsShapes which uses Java's text rendering to draw shapes onto
the PDF.  In theory you lose text selectability, but Java's text rendering
handles all the ligatures and BiDi rendering correctly.

When I printed to PDF something that I see on my application, they were not
identical, so I've created a variation on the official sample that
demonstrates what I think is incorrect behavior.  I took the longer of the
two runs of adjacent Arabic characters (to eliminate bidi issues) from the
sample and rendered it to the PDF, then grabbed the first character from the
string and drew that.  If I understand proper rendering correctly, the first
character of the string (String.substring(0,1)) should be rendered as the
right-most character in the PDF.  Allowing for character variation due to
ligatures, it looks to me like it is not, it appears as the leftmost
character.

http://www.nabble.com/file/p18411435/ArabicTextSubstring.java
ArabicTextSubstring.java  Compiled & run with Java 1.6.0 & iText 2.1.2u

Is it a known issue that Arabic and Hebrew will not render RTL as they
should, even if you use createGraphicsShapes?  Must I use something like
MultiColumnText with the setRunDirection method, or can use I PDFGraphics2D?

Thanks for your assistance,

-Carl
-- 
View this message in context: 
http://www.nabble.com/Arabic-text-runs-LTR-using-createGraphicsShapes-tp18411435p18411435.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to