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

Akira TAGOH akira at tagoh.org
Wed Nov 14 09:28:06 UTC 2018

On Thu, Nov 8, 2018 at 5:54 PM Alexander Larsson
<alexander.larsson at gmail.com> wrote:
> However, maybe the global uuid thing might be overly complicated. Why
> don't we just *allow* uuid files, but don't auto-create them. Then
> anything that doesn't support mtimes (flatpak runtime, silverblue os
> image) can manually create uuid files, but we fall back to using the
> path+mtime like before if there is not uuid file. This would allow us
> to solve issue 1 where needed, leaving us with only issue 2.
> So, for issue 2, keiths proposal is to have:
>         <dir map="/usr/share/fonts">/run/host/fonts</dir>
> This is problematic for two reasons.
> First of all, what does it mean? If we're looking for caches for
> /run/host/fonts, should we use "/usr/share/fonts" as the lookup key?
> But that key is also used for whatever is in the container at
> /usr/share/fonts, so the two would use the same cache! (Although, if
> the container uses a .uuid file for /usr/share/fonts this is not a
> problem.)
> Secondly, we also need a /run/host/user-fonts mapping, and the exact
> directory this maps to is dynamically generated (as
> $XDG_DATA_HOME/fonts or $HOME/.fonts depending on what is in use).
> This means that the config snippet has to be runtime generated, and I
> much prefer if I could use a static file (as it would then work with
> old versions of flatpak).
> I think here we can also use optional uuid files to fix things. If we
> require that any setup that bind-mounts host font directories use
> .uuid files for its own directories, then the /run/host/fonts <=>
> /usr/share/fonts conflict goes away and the map= option above works.
> Also, if we auto-generate a uuid file for ~/.fonts (which i imagine is
> less problematic than /usr) we will not have any need for dynamic
> configuration.
> Do you think that would work? It does set some limitations on how
> fontconfig should be used in containers and on mtime-less systems,
> which probably should be documented somewhere.

Making .uuid optional would be easier. and if you can create a symlink
from existing cache to the corresponding name with your own .uuid, we
don't need to have mappings even. that eventually works as what
currently fontconfig does. or do you want to use this optional uuid
for runtime, app and user only, and mappings for host?

> > Also there are the problem on storing those caches into one directory.
> > fontconfig will cleans up the unused (invalid) caches at runtime. so
> > some of them might be picked up by it accidentally.
> Each app has a custom $XDG_CACHE_DIR so the caches of two different
> apps will not see each others fallback caches. For the other caches
> (host, runtime) these are read-only and will never be cleaned up.

Alright. thanks.


More information about the Fontconfig mailing list