[reportlab-users] Verdana TrueType Font in ReportLab 1.17
Marc Stober
reportlab-users@reportlab.com
Thu, 10 Apr 2003 12:26:43 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2FF7D.F92595A0
Content-Type: text/plain
Hi,
I am finding that my code to use the Verdana True Type font that works in
version 1.16 doesn't work in version 1.17. It seems like Verdana is already
mapped in 1.17 in a way that I register the font myself, but neither can I
use it on my system. Can anyone explain what's going on? Here is some sample
code that works in 1.16 but not 1.17:
from reportlab.pdfgen import canvas
c = canvas.Canvas('ttftest.pdf')
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
# raises error in 1.17 that font is already mapped,
# but can't seem to use the font without this line either
pdfmetrics.registerFont(TTFont('Verdana', 'Verdana.ttf'))
c.setFont('Verdana', 36)
c.drawString(10, 700, 'This is a test.')
c.save()
Thanks in advance!
- Marc
__________________________________________________
Marc Louis Stober
mstober@dalbar.com - 617-624-7155
DALBAR, Inc.
The measurement of success.
------_=_NextPart_001_01C2FF7D.F92595A0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Verdana TrueType Font in ReportLab 1.17</TITLE>
</HEAD>
<BODY>
<BR>
<P><FONT SIZE=3D2>Hi,</FONT>
</P>
<P><FONT SIZE=3D2>I am finding that my code to use the Verdana True =
Type font that works in version 1.16 doesn't work in version 1.17. It =
seems like Verdana is already mapped in 1.17 in a way that I register =
the font myself, but neither can I use it on my system. Can anyone =
explain what's going on? Here is some sample code that works in 1.16 =
but not 1.17:</FONT></P>
<P><FONT SIZE=3D2>from reportlab.pdfgen import canvas</FONT>
<BR><FONT SIZE=3D2>c =3D canvas.Canvas('ttftest.pdf')</FONT>
<BR><FONT SIZE=3D2>from reportlab.pdfbase import pdfmetrics</FONT>
<BR><FONT SIZE=3D2>from reportlab.pdfbase.ttfonts import TTFont</FONT>
</P>
<P><FONT SIZE=3D2># raises error in 1.17 that font is already =
mapped,</FONT>
<BR><FONT SIZE=3D2># but can't seem to use the font without this line =
either</FONT>
<BR><FONT SIZE=3D2>pdfmetrics.registerFont(TTFont('Verdana', =
'Verdana.ttf'))</FONT>
</P>
<P><FONT SIZE=3D2>c.setFont('Verdana', 36)</FONT>
<BR><FONT SIZE=3D2>c.drawString(10, 700, 'This is a test.')</FONT>
<BR><FONT SIZE=3D2>c.save()</FONT>
</P>
<P><FONT SIZE=3D2>Thanks in advance!</FONT>
<BR><FONT SIZE=3D2>- Marc</FONT>
<BR><FONT =
SIZE=3D2>__________________________________________________</FONT>
<BR><FONT SIZE=3D2>Marc Louis Stober</FONT>
<BR><FONT SIZE=3D2>mstober@dalbar.com - 617-624-7155 </FONT>
<BR><FONT SIZE=3D2>DALBAR, Inc.</FONT>
<BR><FONT SIZE=3D2>The measurement of success.</FONT>
<BR><FONT SIZE=3D2> </FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C2FF7D.F92595A0--