[reportlab-users] Using <b></b> with TTFont

Tim Roberts timr at probo.com
Mon Feb 5 13:11:17 EST 2007


Riaan Bekker wrote:

>

>

>

> As soon as I load the Arial font using the TTFont I lose the

> functionality to use the bold tags. How can I enable this to work ?

>


Remember that, in TrueType, a bold font is a completely different font
file from the roman version. You have to register the bold version, and
then tell Platypus how to find it. Something like this should work, I
think:

from reportlab.lib import fonts
pdfmetrics.registerFont( TTFont( 'ArialBold', 'arialbd.ttf' ) )
fonts.addMapping( 'arial', 1, 0, 'ArialBold' )

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list