[reportlab-users] RTL Patch Committed

Yoann Roman yroman-reportlab at altalang.com
Tue Nov 24 08:01:11 EST 2009


Andy Robinson wrote...

>> Since I keep bringing this up, I figured I'd actually *show* what I'm

>> talking about. Attached are three files:

>> Again, I haven't seen something that does this in Python, but I think

>> this issue should be mentioned in a RL release with Pyfribidi to

>> avoid problems from people assuming proper shaping for all languages.



> I'm confused. Are you using pyfribidi2-0.8.0 linked to

> fribidi-0.19.2? i.e. built with the exact instructions Hosam gave

> this morning (note especially the 'sed' command)?

>

> I ask because I notice your script does 'import pyfribidi' and NOT

> 'import pyfribidi2'.


I am using those versions, but the build process is different since this
is on Windows. The "import pyfribidi" is simply because I had renamed
pyfribidi2.pyd to pyfribidi.pyd on my machine. Are you getting different
results with your build?


> We followed what he said and the Arabic example, which had previously

> reversed the characters but failed to combine them, corrected itself

> and combined pairs properly (according to our native speaker). i.e.

> log2vis outputted different code points which the font engine was able

> to combine.


I am getting shaping. You can see that in the PDF the script outputs.
The unshaped code points look quite a bit different than the shaped
version. The issue is that this legacy approach at shaping (replacing
code points with shaped code points) does not provide full coverage for
Arabic script languages such as Pashto.


> However, I know next to nothing about these writing systems and only

> had an hour to spare on it today. In particular I don't know if you

> are describing an issue common to Arabic and Pashto. I will continue

> my crash course in RTL languages tomorrow ;-)


In my experience, Arabic (the language) shaping seems to be fully
covered by the Arabic Presentation Forms blocks. But we've run into 2
Arabic script languages so far, Pashto and Farsi, that aren't fully
covered.

ICU's documentation explains the two different shaping processes:
http://icu-project.org/apiref/icu4c/ushape_8h.html#1f89291c5a24a50b8f6dcad5eb4
668f7

--
Yoann Roman



More information about the reportlab-users mailing list