[reportlab-users] Problem with using TTFont in chart

Yura Asyutin yasyutin at gmail.com
Tue Sep 19 10:41:28 EDT 2006


Actually, I get errors, when try to use TTFont, while creating chart image.
Errors occured in reportlab.graphics.RenderPM._setFont() method. I see that
method supports only Type 1 fonts, using _renderPM.makeT1Font(), when I try
to use registered font object of TTFont class.

Could you point me an example of using TTFont in image?

Thanks.




2006/9/19, Robin Becker <robin at reportlab.com>:
>
> Yura Asyutin wrote:
> > Robin, hi!
> >
> > I tried to use TTFont, while rendering text in graphic charts and run
> into
> > the same problem, described here:
> >
> > http://article.gmane.org/gmane.comp.python.reportlab.user/4853
> >
> > Need to use TTFont is to internationalize chart labels, to use UTF-8.
> >
> >
> >
> > Also I found your answer about this:
> >
> http://two.pairlist.net/pipermail/reportlab-users/2003-November/002402.html
> >
> > As I understand, you successfully used TTFont by RenderPM, avoiding call
> to
> > _renderPM.makeT1Font, that renders only Type1
> > fonts.
> >
> > Unfortunately, I couldn't succesfully use TTFont in chart. Could you
> > describe more detailed the way to do it (example would be appreciated)?
> Is
> > it possible to use ttfont in chart?
> > Is there any other way to internationalize charts ( to use UTF-8)?
> >
> > Thanks, Yuriy Asyutin.
> >
> Yuriy if you look in the reprotlab/graphics/testshapes.py file there's an
> example of using ttf fonts at the bottom (getDrawing13). Basically you
> need to
> register the font and then use it
>
>         from reportlab.pdfbase import pdfmetrics, ttfonts
>         pdfmetrics.registerFont(ttfonts.TTFont("LuxiSerif", "luxiserif.ttf
> "))
>
> ......
>
>         String(x, y, text, fontName='LuxiSerif', fontSize = fontSize)
>
> LuxiSerif is only an example font so doesn't have many characters.
> --
> Robin Becker
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://two.pairlist.net/pipermail/reportlab-users/attachments/20060919/4d1b27b4/attachment.html


More information about the reportlab-users mailing list