[reportlab-users] TTF unicode support patch

andy at reportlab.com andy at reportlab.com
Mon Apr 4 04:34:50 EDT 2005

Can you send us a small, 'Hello World'-type script which
says something in Thai, and also tell us what fonts or
Acrobat reader plugins are needed to view it?  I would be
happy to add this to the test suite immediately and to try
out this patch.  We have to be very careful though, and
make sure it does not affect any customer applications.

Best Regards,

Andy Robinson

-----Original Message-----
From: Sakesun Roykiattisak <sakesun at boonthavorn.com>
To: reportlab-users at reportlab.com
Sent: Mon, 04 Apr 2005 10:19:15 +0700
Subject: [reportlab-users] TTF unicode support patch

Basicly, I know nothing about TTF or PDF. Anyway, I want reportlab to
work with my language (Thai).
I've made a little change to PDFTextObjet._formatText in

def _formatText(self, text):
  "Generates PDF text output operator(s)"
  if self._dynamicFont:
  # Add the following line
  if isinstance(text, unicode): text = text.encode('utf-8')

Now my language is working. I just wonder if it would break anything.
And I also wonder why it was not implemented this way from the first
instance ?

reportlab-users mailing list
reportlab-users at reportlab.com

More information about the reportlab-users mailing list