[Fontconfig-bugs] [Bug 101889] Make fontconfig cache relocatable

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 24 06:14:59 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101889

--- Comment #1 from Akira TAGOH <akira at tagoh.org> ---
Proposed implementation:
  https://cgit.freedesktop.org/~tagoh/fontconfig/log/?h=relpath-cache-2

The features of this implementation and highlight:

* Writing out FC_FILE value as the fixed string (with the length of PATH_MAX)
to allow rewriting it according to the currrent fonts.conf and the location of
cache dirs.
* Changing the cache basename from the hash to the device ID + inode number.
which is required to avoid scanning fonts (and dirs) when the targeted dirs
aren't yet loaded as caches.
* For those changes, FC_LEAF_FILE, FC_DEV_ID, and FC_INODE properties is added
to cache and bumped the cache version to 8.
* Set FONTCONFIG_LOOKUP_FONTPATH to 1 to enable this feature. when loading
caches through mmap(), need to re-mapping it with MAP_PRIVATE because rewrite
has to be done without affecting the original cache. so we can share it with
host and bind-mounted env. this is the sort of workaround to reduce the cost on
env where this isn't needed.

The last one is surely a disadvantage on this implementation because
applications can't see the benefit of updates coming from other processes
through MAP_SHARED. so they have to restart applications every time when caches
is updated.

Also this is only enabled for non-win32 so far because I'm not confident if
this works on win32.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fontconfig-bugs/attachments/20170724/97ecfc85/attachment.html>


More information about the Fontconfig-bugs mailing list