[reportlab-users] RTL Patch Committed

Robin Becker robin at reportlab.com
Mon Nov 23 07:03:24 EST 2009

Hosam Aly wrote:

> Robin Becker wrote:




> Hello Robin. I am thinking about using UTF-16 because, I guess, we would

> be writing character points instead of font code points. When we are

> using font code points, the reader has no option but to render the font

> glyphs that we wrote. I wanted to see, if we used character points

> instead, whether the reader would be smart enough to do the shaping itself.



I think that is right, but then the font has somehow to be known to Acrobat
Reader. I know this works in the CJK case for the places where pdfdoc encoding
would normally be used. UTF16 is required because the fonts for the standard
document annotations are not declared so the fonts have to be standard.

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.
Robin Becker

More information about the reportlab-users mailing list