[cairo] scaled_font lifecycle issue

Fred Bca fredbca21 at gmail.com
Fri Apr 15 16:43:53 UTC 2016


My problem here is not with the cache, which is properly implemented,
removing scaled fonts when not in use anymore (refcount=0), which also
removes the associated font_face from the cache if not used elsewhere.

The issue comes from the additional optimization that consists in
storing UNUSED fonts in the hold_overs list as well as in the
mru_scaled_font item. I am just proposing an API to configure cairo
not to use these additional lists, so that fonts that are not used
anymore are released as expected when using external system fonts.


On Sun, Apr 10, 2016 at 4:20 AM, Lawrence D'Oliveiro
<ldo at geek-central.gen.nz> wrote:
> On Sun, 10 Apr 2016 11:27:31 +0930, Adrian Johnson wrote:
>
>> On 10/04/16 09:08, Lawrence D'Oliveiro wrote:
>>
>>> A more general invalidate-cache-for-specified-font-face function
>>> would be very useful. It would help with use of multiple-master-type
>>> font technologies.
>>
>> I'm not sure how well this would work for PDF/PS/SVG as these backends
>> hold on to the font_face of every font used until after all pages have
>> been emitted before all the fonts are emitted.
>
> I guess the only answer is to do what we already do now, and that is
> have separate font_face objects, so that Cairo maintains a separate
> cache for each. Just it would be nice if these could share underlying
> font data somehow, instead of having to load multiple copies.
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list