[reportlab-users] tag handling in paragraphs.

Marius Gedminas reportlab-users@reportlab.com
Wed, 4 Jun 2003 12:43:34 +0300


On Mon, Jun 02, 2003 at 09:51:44AM +0200, Christoph Zwerschke wrote:
> >>> be solvable. By the way, which encoding is used under Linux? Win or Mac?
> So
> >>> maybe I could check it under Linux.
> >> Neither.  Some use ISO 8859-1, some use ISO 8859-15, some use other ISO
> >> 8859 family encodings, more and more start to use UTF-8.
> 
> I think you misunderstood me. My question was about the reportlab standard
> encoding. As far as I understand now, it is always WinAnsi, but you can
> change it (manually) to MacRoman in rl_config if you like.

You can define a custom encoding.  You need to provide a mapping from 8
bit character codes to Adobe glyph names and register it with
pdfmetrics.registerEncoding.  These encodings can be used with Type 1
fonts.

The encoding of text passed to drawString depends on the selected font.
You can register and use different fonts with different encodings in the
same document.  Or you can register and use the same font with different
encodings, if you specify different font names.  If you use the default
pre-registered fonts, you'll get the default encoding (IIRC you can
specify the default on a per-document basis).

TrueType fonts always use UTF-8 as the encoding for text passed to
drawString.

Disclaimer: I haven't used Reportlab for quite some time, and even then
I did not use Type 1 fonts.

Marius Gedminas
-- 
Of course everyone knows that vim is the best text editor in the world. Anyone
who tells you differently is either wrong, lying, or criminally insane. (Or an
emacs user, in which case they are wrong, lying and criminally insane).