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

Robin Becker robin at reportlab.com
Tue Jun 13 04:29:01 EDT 2023


On 12/06/2023 14:27, Lele Gaifax 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.
Hi Lele,

I guess this is a packaging bug in freetype-py; presumably there are two versions the python package's and the 
underlying library's.

Yes the rlPyCairo backend uses freetype-py for obtaining font outlines. In the old _renderPM extension we had our own 
code to extract the outlines of fonts. We used the curves so that we can fill ie render glyphs to bitmaps without 
adjusting the positions to match the pixels which is what standard renderers do. I think the original concept was that 
the pixmap images should look exactly like PDF where you can render at fractional positions.

........
> Sorry for the noise,
> bye, lele.

No problem.
-- 
Robin Becker



More information about the reportlab-users mailing list