[reportlab-users] Issues with registerFont and addMapping

mydevel at free.fr mydevel at free.fr
Sat Jul 16 13:14:25 EDT 2005


Hello,

I'm using unicode trutype fonts (gnu freefont) to render UTF-8 text with 
reportlab (1.19). It renders well when I draw directly on canvas and 
explicitly set the font.

Problems begin with platypus : I can't add sensible mappings with 
lib.fonts.addMappings because pdfmetrics.registerFont already registered 
weird ones !

addMapping('FreeSerif', 0, 0, 'FreeSerif-Roman') #normal
addMapping('FreeSerif', 0, 1, 'FreeSerif-Italic') #italic
addMapping('FreeSerif', 1, 0, 'FreeSerif-Bold') #bold
addMapping('FreeSerif', 1, 1, 'FreeSerif-BoldItalic') #italic and bold

won't work because pdfmetrics.registerFont already neutralized mappings by 
adding such things :

addMapping('FreeSerif-Italic', 0, 0, 'FreeSerif-Italic') #normal
addMapping('FreeSerif-Italic', 0, 1, 'FreeSerif-Italic') #italic
addMapping('FreeSerif-Italic', 1, 0, 'FreeSerif-Italic') #bold
addMapping('FreeSerif-Italic', 1, 1, 'FreeSerif-Italic') #italic and bold

So I CAN NOT use markup (<b>, <i>) in platypus !

So, what can I do ? So please consider removing non-sense mappings from 
pdfmetrics.registerFont.

Sincerely,

Romuald Texier.


More information about the reportlab-users mailing list