[reportlab-users] RTL Patch Committed

Hosam Aly haly at centrivision.com
Thu Nov 19 07:55:53 EST 2009


Hello,


I have committed a patch to the "rtl-support" branch, adding partial RTL
support in "src/reportlab/pdfgen/textobject.py" and
"src/reportlab/platypus/paragraph", based on pyfribidi.


I have also created a set of test cases in "tests/test_paragraphs.py",
in a method called testRTL.


I am attaching the results I got by running the test case, and the
correct expected results, generated by OpenOffice.org's Writer.


Out of 15 test cases, 15 succeeded and 1 failed, which is the sixth one
(line 6 in the generated PDF). The Arabic words should have appeared at
the beginning of the line, but instead they appear at the end. This
issue needs more investigation.


There is still the issue of connecting letters, but that's more related
to Complex Text Layout (CTL) than it is to supporting BiDirectional
rendering. I'll try to tackle that issue next. I am thinking of using
PyICU instead of PyFriBiDi, but I still have to read more about it.


Meanwhile, I read in the PDF standard (version 1.7 from Adobe) that the
PDF text object supports receiving UTF-16BE text, provided that it
starts with the Unicode Byte Order Mark (BOM, U+FEFF). I wonder what
would be the results if we wrote text in UTF-16 instead of writing the
code points in the font? I didn't know how to test this, so I hope
someone can help me.



Best regards,


Hosam Aly

Software Engineer

http://www.linkedin.com/in/hosamaly


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_paragraphs_ar.pdf
Type: application/pdf
Size: 21455 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091119/05fc6af8/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: correctResults.pdf
Type: application/pdf
Size: 22751 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20091119/05fc6af8/attachment-0003.pdf>


More information about the reportlab-users mailing list