[reportlab-users] Problems with certain Greek letters and unicode
Matt Folwell
mjf at pearson.co.uk
Fri Aug 15 11:50:08 EDT 2008
Peter Cock wrote:
> 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?
>
Yes it can, if the ReportLab folks want it.
>> 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).
That makes sense, as micro sign is in the WinAnsi encoding. I suppose
the WinAnsi codec could also encode \u03bc. Would that be useful, or
would it be better to leave it out, so if you're using the greek
alphabet codepoints you get consistent substitution behaviour?
Matt
More information about the reportlab-users
mailing list