Prepare for fontconfig changes
Context
There used to be an issue with using fonts from host. Because the paths to the font directories were mounted at a different place, the cache from host could not be reused. That means at application startup, the cache would be regenerated in $XDG_CACHE_HOME/fontconfig
. This would happen at first start up but also after each time some fonts were changed on the host.
To work-around this, fontconfig attributed UUIDs to font directories. There has been issues with this so they are planning to change it.
The hash of the path will be used as identifier like before. However, font directories will be able to be "remapped" to give their original path in order to get the right hash for the host cache. And in order to avoid conflicts with Freedesktop SDK, we will be able to add salt to the hash for the Freedesktop SDK font directories.
Fontconfig will have some fallback for using UUIDs if present. But it will not assign them anymore. That means in newer distributions, the UUIDs will disappear. Without UUIDs the current version of fontconfig will not get the right cache identifier, it will fail to use the host cache and we will take a lot of time in app startup again.
For that reason we will have to update fontconfig as soon as this is released and backport needed changes to 18.08.
Description
-
Add a salt configuration for our font directories. This should be only for flatpak images. Not VM. -
Update 19.08 to the new fontconfig. -
Backport salt changes to fontconfig in 18.08.
Acceptance Criteria
In order to test you need to check .var/app/<app>/config/fontconfig/
after running the application. This directory should be empty or nearly empty. If not, there is an issue.
This issue will be fixed when:
- Running on a distribution with the new fontconfig and no
.uuid
files present in font directories.- Applications using 18.08 do not create a cache
- Applications using 19.08 do not create a cache
- Running on a distribution with the old fontconfig and
.uuid
files present.- Applications using 18.08 do not create a cache
- Applications using 19.08 do not create a cache