[reportlab-users] Problems with certain Greek letters and unicode

Peter Cock p.j.a.cock at googlemail.com
Wed Aug 13 06:07:59 EDT 2008


Hi Mat,

On Wed, Aug 13, 2008 at 10:22 AM, Matt Folwell wrote:

> Peter Cock wrote:

>

>> U0394 - missing, upper case delta

>> U03A2 - missing, because there is no uppercase variant of sigma at the

>> end of a word

>> U03A9 - missing, upper case omega

>> U03BC - missing, lower case mu

>

> Those (apart from sigma) are characters with more than 1 unicode codepoint,

> and the codec that reportlab registers for symbol only encodes the other

> one. The attached patch to rl_codecs.py will let you use those codepoints.


I applied the patch by hand (diff didn't like it and it was trivial),
and indeed that does solve my original problem. Could/should this be
included in the official reportlab codebase?


> Alternatively you can use U2126 OHM SIGN for Omega, U2206 INCREMENT

> for Delta and U00B5 MICRO SIGN for mu.


Using u"\u2206" for the increment (aka Delta) works, as does u"\u2126"
for Ohms (aka Omega). Using u"\u00b5" for the micro sign (aka mu)
works fine, but interestingly the four built in fonts I was using all
seem to include their own versions of this character. Note that
python will shorten this to just u'\xb5' which is equivalent (drops
the leading double zero).

Thanks for your help!

Peter


More information about the reportlab-users mailing list