[Fontconfig] how to detect `fontconfig needs a long time'

Werner LEMBERG wl at gnu.org
Thu Jul 21 04:57:19 UTC 2016


>> Given that it can take a few minutes if executed the first time,
>> such an API is highly desirable IMHO.
> 
> Agreed. how it can be implemented may needs to be discussed though.

Certainly.

Here's my solution for ttfautohint (showing the non-GUI version).

  http://repo.or.cz/ttfautohint.git/blob/HEAD:/lib/ttfautohint.h#l80
  http://repo.or.cz/ttfautohint.git/blob/HEAD:/frontend/main.cpp#l1291
  http://repo.or.cz/ttfautohint.git/blob/HEAD:/frontend/main.cpp#l104

>> OK.  So how can an application find out that the font cache
>> creation (or update) is very time consuming?  Is it at least
>> possible to catch the situation of a first run?
> 
> current implementation assumes the users will runs fc-cache to
> create caches before running.  as such APIs isn't available at this
> point, so no, it isn't.  though we discussed a bit these days, if it
> is wrong assumption, we may need to think about another way IMHO.

Given that many applications that use fontconfig are ported to Windows
today, the assumption of running `fc-cache' in advance is becoming
much weaker IMHO – there is no longer a global fontconfig cache, since
every program comes with its own stuff.[*] I hate this approach a lot,
but we have to face the reality on this platform...


    Werner


[*] An exception is to use a package manager like
    http://chocolatey.org, but this is not as common (yet?) as on
    OS X, AFAIK.


More information about the Fontconfig mailing list