[reportlab-users] RTL Patch Committed

Robin Becker robin at reportlab.com
Mon Nov 23 10:39:44 EST 2009


Hosam Aly wrote:
............

>> If you modify the test_hello.py test file ie

>>

>> change line 19 to

>>

>> c.setAuthor(u'\u0643\u0644\u0627\u0645 \u0639\u0631\u0628\u064a')

>>

>> then in the document properties you will see that Acrobat Reader does

>> get the visual reversal and character shaping correct (tested in

>> ubuntu and windows).

>>

>> However, I haven't declared any font there so presumably Acrobat is

>> using some standard system font.

>

>

> I have tried changing the author text, and it worked as you said, but

> that's probably irrelevant to PDF rendering. The text is being shown in

> a text box, which uses the platform's APIs (Windows, GTK, etc.) to do

> the rendering, and those APIs automatically handle bidirectionality and

> character shaping.

>

>

> What I really want to do is to get a UTF-16 sequence of characters

> inside the brackets of a BT tag, to get something similar to this:

>


currently all rendered text requires a font to be set and an encoding. It may be
that we can use utf16 at the point of specifying the text. However, I don't
know what should go into that text; either it should be font code points or
unicode glyph points. If it's uncode then presumably Acrobat has to support the
proper lookup and all the encoding stuff goes out the window.



>

> BT

>

> /F13 12 Tf

>

> 288 720 Td

>

> (\xff\xfe-\x063\x06'\x06E\x06) Tj

>

> ET

>

>

> (using a font that supports Arabic characters)

>

>

> So I was wondering how I could get ReportLab to write a similar string

> into the PDF. I wish to know which method(s) I should be calling, or

> where to edit in ReportLab's code to test my hypothesis.

>

>

>

> Thank you,

>

>

> Hosam Aly

>

> Software Engineer

>

> Centrivision

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>



--
Robin Becker


More information about the reportlab-users mailing list