[reportlab-users] TTF Problem

Andy Robinson andy at reportlab.com
Mon Feb 27 15:52:29 EST 2006


Tim Roberts wrote:
> Symbol fonts have the same basic problem to solve.  The Symbol font
> character set is an 8-bit character set that runs from 0x20 to 0xFF. 
> The mapping from that 8-bit character set to Unicode happens to be much
> simpler than most character set mappings: you just add 0xF000 to the
> character set to get the Unicode code point.

It's good this came up as I had not thought of it.  Symbol and 
ZapfDingbats are standard 'builtin' fonts and logically one should be 
using the correct Unicode code points - or at least support them.

If we move to a purist Unicode approach in version 2.0, I wonder if we 
will need some explicit sugar to make this taste less painful?

One possibility is that we could add some flags and offsets when someone 
registers a font, so that you can just pass in
   registerFont(TTFont("my_symbols.ttf", offset=0xF000)
and then continue to use the bytes you used to use.

Or should we force everyone to learn the right code points? Including 
ourselves ;-)

- Andy





More information about the reportlab-users mailing list