Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.11k stars 678 forks source link

Don’t cache Pango fonts #2149

Closed liZe closed 4 months ago

liZe commented 4 months ago

As pango_font is a pointer, equality is done with the address of the pointer, not the actual font. Pango fonts don’t change for a defined Pango map, but it’s possible with two different Pango maps to get different fonts stored at the same address.

Calculating the description hash is cheap, so we can avoid the cache. But we really should cache this in the FontConfiguration object where the Pango map is stored.

Fix #2144.