[reportlab-users] i am asking again about the arabic thing, on the hope that anyone might reply back
Sun, 2 Nov 2003 01:03:51 +0100
On Sat, Nov 01, 2003 at 03:57:24PM -0800, sarah el-lawindy wrote:
> hi there,
> ok , noone replied my perviuos question, i hope that anyone replies this one.
> i tried the code of ttf part in the user guide of reportlab (incase u don't know, the rina ttf), there were no error , and at the same time, no pdf was generated, does anyone know why?
> sam ellawindy
> ps, this is the code
> # we know some glyphs are missing, suppress warnings
> import reportlab.rl_config
> reportlab.rl_config.warnOnMissingFontGlyphs = 0
> from reportlab.pdfbase import pdfmetrics
> from reportlab.pdfbase.ttfonts import TTFont
> pdfmetrics.registerFont(TTFont('Rina', 'rina.ttf'))
> canvas.setFont(Rina, 32)
> canvas.drawString(10, 150, "Some text encoded in UTF-8")
> canvas.drawString(10, 100, "In the Rina TT Font!")
your code is incomplete.
you should add (from memory) :
from reportlab.pdfgen import canvas
canvas = canvas.Canvas()
... your code here