[reportlab-users] Problem using drawToFile() using PyCairo backend

Andy Robinson andy at reportlab.com
Mon Jun 12 11:13:50 EDT 2023


Many thanks for your investigations.  I'll have to let Robin Becker assess
this one; we are out of the office today...

- Andy

On Mon, 12 Jun 2023 at 15:27, Lele Gaifax <lele at metapensiero.it> wrote:

> Lele Gaifax <lele at metapensiero.it> writes:
>
> > I will dig further to understand what is going on in the app context,
> > that apparently has the same versions of those packages, except for
> > Pillow, which is at version 9.4.0...
>
> Ok, I found the culprit. For some reason, the app context had an old
> version of freetype-py, not the required 2.4.0, and that old version did
> not have the Outline.decompose() method. It didn't help the fact that
> freetype.version() actually returns the underline wrapped library, not
> the version of the Python wrapper itself.
>
> Basically, I had this in a standalone fresh virtualenv
>
>     >>> import freetype
>     >>> freetype.version()
>     (2, 13, 0)
>     >>> face =
> freetype.Face("/home/lele/3rd/reportlab/src/reportlab/fonts/Vera.ttf")
>     >>> face.set_char_size( 48*64 )
>     >>> face.load_char('S')
>     >>> face.glyph.outline
>     <freetype.Outline object at 0x7fd266a9eb90>
>     >>> face.glyph.outline.decompose
>     <bound method Outline.decompose of <freetype.Outline object at
> 0x7fd266a9e980>>
>
> while doing the same in my app context I saw
>
>     >>> import freetype
>     >>> freetype.version()
>     (2, 13, 0)
>     >>> face =
> freetype.Face("/home/lele/3rd/reportlab/src/reportlab/fonts/Vera.ttf")
>     >>> face.set_char_size( 48*64 )
>     >>> face.load_char('S')
>     >>> face.glyph.outline
>     <freetype.Outline object at 0x7fffe99a14d0>
>     >>> face.glyph.outline.decompose
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     AttributeError: 'Outline' object has no attribute 'decompose'
>
> Sorry for the noise,
> bye, lele.
> --
> nickname: Lele Gaifax | Dire che Emacs è "conveniente" è come
> real: Emanuele Gaifas | etichettare l'ossigeno come "utile"
> lele at etour.tn.it      |                           -- Rens Troost
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
>


-- 
Andy Robinson
Managing Director, ReportLab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20230612/2838567f/attachment.htm>


More information about the reportlab-users mailing list