[reportlab-users] RenderPM and TTF fonts
Nizam Sayeed
ibnameen at gmail.com
Wed Oct 10 14:23:59 EDT 2007
Robin,
I do have the Vera fonts installed. The font registers fine because I can
use it when rendering PDFs using renderPDF but when I try to use renderPM to
create a PNG, it gives the error about not being able to find T1 files. As
you said, renderPM does not support TrueType fonts yet.
I am currently using a Type 1 font with renderPM. But this wont work because
I display Unicode characters.From what I know, the Type 1 standard does not
support Unicode characters. And TrueType is not supported on renderPM. So
what other option is there?
Best regards,
Nizam
On 10/10/07, Robin Becker < robin at reportlab.com> wrote:
>
> Nizam Sayeed wrote:
> > I saw an example in the code and did this:
> >
> > pdfmetrics.registerFont( ttfonts.TTFont( "Vera", "Vera.ttf" ) )
> >
> > But I am getting this error:
> >
> > Can't setFont(Vera) missing the T1 files? Originally
> > exceptions.AttributeError: TTEncoding instance has no attribute 'vector'
> >
> > I guess it does not handle TTF fonts. So what is the solution when
> trying to
> > display unicode text using RenderPM? I had converted my TTF font to Type
> 1
> > using ttf2pt1 but it does not seem to preserve the unicode glyphs. I was
> > getting this error when trying to use the converted font:
> >
> > 'utf8' codec can't decode bytes in position 10-12: invalid data
> >
> > What can I do? Any help would be greatly appreciated.
> >
> .......
>
> the renderPM extension does support true type fonts. I suspect something
> is
> wrong with your installation if there's no Vera font in the
> reportlab/fonts folder
>
> this script runs fine on my machine
>
> from reportlab.pdfbase import ttfonts, pdfmetrics
> f=ttfonts.TTFont('Vera','Vera.ttf')
> pdfmetrics.registerFont(f)
>
> My reportlab/fonts folder contains the following related files
>
> Vera.ttf
> VeraBI.ttf
> VeraBd.ttf
> VeraIt.ttf
> bitstream-vera-license.txt
>
>
>
>
> >>
> >> I have a quick question. Does RenderPM support TTF fonts? And if so,
> how
> >> do I do this? I wanted to use a unicode font because I will need to
> create
> >> charts that will display French text. Thanks.
> >>
> >> Best regards,
> >>
> >> -- Nizam Sayeed
> .......
>
>
> --
> 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/20071010/a1db6933/attachment.htm>
More information about the reportlab-users
mailing list