[reportlab-users] Re: Using UTF-8 strings with ReportLab.

Andy Robinson andy at reportlab.com
Wed Dec 21 02:43:11 EST 2005

> That's good to hear; as I've posted previously, I have UTF-8 working 
> perfectly with ReportLab using TTF fonts - the only thing I'd ask if at 
> all possible is that I could give a series of fonts for a string and 
> then if a particular glyph was missing from the first, it would go down 
> the line trying each font in turn. On PledgeBank, I have to use 
> different fonts manually in order to get characters to display.

I'm glad you mentioned that.

We will try to get a new wiki up to collect all the use cases.  My
goals for the very first 'version 2.0' are modest enough:  utf8
and unicode strings should go through uncorrupted, and text should
come out right whether used in paragraphs, drawString, table cells
and graphics.  (Right now you have to escape things differently
in different places, and we have magic escapes for greek letters
and symbols when one could just use the Unicode characters). That's
why the new version number - it will break old code.

Part of the challenge is to make more easily subclassable 'text 
handlers' for drawing strings and paragraphs, so one can do what
you want above, and also produce hyphenation/breaking algorithms
not in the core.

There's also a reasonable chance the first cut will run like a
snail because of this, but once the strategies are clear we
can move font lookups into _rl_accel.

> Yay. :-)

Yes, slightly hungover this morning ;-)

- Andy

More information about the reportlab-users mailing list