[Fontconfig] Lazy caching

Behdad Esfahbod behdad at behdad.org
Fri Mar 11 06:06:15 UTC 2016

On Thu, Mar 10, 2016 at 9:53 PM, Keith Packard <keithp at keithp.com> wrote:

> Behdad Esfahbod <behdad at behdad.org> writes:
> > I've started to convince myself that fontconfig should NOT by default
> cache
> > the charset info of all fonts, and do so only lazily.  This will solve
> most
> > of the "caching is slow" issues...  Needless to say, that's better done
> in
> > a fontconfig3...
> How would it perform font matching based on language then? Ask for a
> Japanese 'sans-serif' font and you'll get dejavusans...

For system fonts, the cache will be as it is right now.  For anything else,
user processes just compute the coverage the first time it's actually
needed.  That means the lang/charset scoring needs to be lazy.  The point
being that a painful majority of times, the match is clear already based on
family name matching, and the fact that the matched family supports the
language requested.

We still be doing all the things we do right now.  Just postpone computing
the charset to the first time it's actually needed, and add it to the cache

> --
> -keith

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20160310/a696ddfa/attachment-0001.html>

More information about the Fontconfig mailing list