[Fontconfig] [PATCH] Do not remove UUID file when a scanned directory is empty 1 x

Akira TAGOH akira at tagoh.org
Mon Nov 5 11:31:25 UTC 2018

On Mon, Nov 5, 2018 at 6:18 PM Alexander Larsson
<alexander.larsson at gmail.com> wrote:
> I don't see why we can't just fix the empty-directory regenerating
> uuid case instead?

Because people doesn't want to see creating a file under
/usr/share/fonts say on host. that's the most concerns/complaints I've
ever seen and this way may looks negative approach like returning to
the old behavior where we had created cache files under /usr in the
past I guess.

Hmm, I totally missed the point that flatpaks can have own fonts in
the container under /usr/share/fonts where the host fonts is installed
and could be different. indded mapping font directories may not help
in this case.

For another idea that satisfies not creating a file under /usr, can
flatpak rebuild symlinks at the startup time?
That is to represent mapping between UUID (or the unique value if it
doesn't like) and dir to a symlink.

The directory structure looks like at host:
  \___<unique value>-le64.cache-7
   \___<unique value>.dir -> /usr/share/fonts/foo

At the container:
  \___<unique value>-le64.cache-7
/run/host/fonts-dirs/ or somewhere else:
  \___<unique value>.dir -> /run/host/fonts/foo

So fontconfig can knows where it is from symlink instead of the
location of .uuid file. look at the filename of symlink to access
cache. then can open caches against it or update as needed. flatpaks
just needs to create symlinks with the same filename but to the proper
paths. it can be used instead of <dir> elements in config file

Eventually fontconfig should drops the hardcoded paths in cache and
need to change API too to get the real path for current env. this can
be the plan for next major release,  fontconfig 3 in the future, but

> [1] https://github.com/debarshiray/fedora-toolbox
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig


More information about the Fontconfig mailing list