For flatpak: ``` bind mount: /run/host/fonts <- /usr/share/fonts /run/host/user-fonts <- ~/.local/share/fonts
/run/host/fonts-cache <- /usr/lib/fontconfig/cache /run/host/user-fonts-cache <- ~/.cache/fontconfig ```
For fontconfig: https://bugs.freedesktop.org/show_bug.cgi?id=101889 https://github.com/flatpak/flatpak/issues/589 It supports relocatable cache. ``` FcConfigGetFontDirs( config ) -> /run/host/user-fonts/test,... FcPatternGetString( pattern, FC_FILE, 0, &filename ) -> ~/.local/share/fonts/test/test.ttf ```
For wine: ``` FcPatternGetString -> unix_name -> add_unix_face( unix_name, ... ) ``` The valid file path for flatpak is `/run/host/user-fonts/test/test.ttf`. `~/.local/share/fonts/test/test.ttf` does not exist in flatpak sandbox.
Add a check for this, and switch to right path.