Fonts: Difference between revisions
Simplified the Flatpak font/icon/theme fixes part and made them directly use the host font/icon/theme instead of manually declaring separate packages |
Move the Flatpak font fix stuff into a new page as it is also applicable for things outside of Flatpaks and the same fix is applicable to things outside of fonts |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 295: | Line 295: | ||
The new preferred location is in <code>$XDG_DATA_HOME/fonts</code>, which for most users will resolve to <code>~/.local/share/fonts</code></translate><ref>https://lists.freedesktop.org/archives/fontconfig/2014-July/005270.html</ref> | The new preferred location is in <code>$XDG_DATA_HOME/fonts</code>, which for most users will resolve to <code>~/.local/share/fonts</code></translate><ref>https://lists.freedesktop.org/archives/fontconfig/2014-July/005270.html</ref> | ||
<translate>=== Flatpak applications can't find system fonts === | <translate> | ||
=== Flatpak applications can't find system fonts === | |||
See: [[Fixes for non-Nix applications#Flatpak, Distrobox, Appimage and other non-Nix applications can't find system fonts/icons/themes]] | |||
==== Alternative fixes for Flatpak apps ==== | |||
This section documents alternative fixes for Flatpak apps. | |||
Note that font cache inside flatpak container may not be recreated after changes to fonts in <code>/usr/share/fonts</code>, because font cache seem to be relying on file timestamps that are missing in <code>/nix/store</code>. | |||
You can make sure that font directory is bind-mounted properly inside flatpak container by running<code>flatpak enter <instance> findmnt | grep /run/host/fonts</code> or by running <code>flatpak enter <instance> ls -alh /run/host/fonts</code> and compare it to <code>ls -alh /usr/share/fonts</code>. | |||
If everything is mounted properly, but you still do not see fonts in flatpak app - force font cache recreation inside flatpak container: | |||
<code>flatpak run --command=fc-cache <application id> -f -v</code> | |||
===== Solution 1: Copy fonts to <code>$HOME/.local/share/fonts</code> =====<!--T:52--> | |||
</translate> | |||
<translate><!--T:53--> | <translate><!--T:53--> | ||
Create fonts directory <code>$HOME/.local/share/fonts</code> and copy system fonts with option <code>-L, --dereference</code>. You will need to repeat this step whenever the fonts change.<syntaxhighlight lang="console"> | Create fonts directory <code>$HOME/.local/share/fonts</code> and copy system fonts with option <code>-L, --dereference</code>. You will need to repeat this step whenever the fonts change.<syntaxhighlight lang="console"> | ||
| Line 326: | Line 331: | ||
</translate> | </translate> | ||
<translate>==== Solution 2: Symlink to system fonts at <code>$HOME/.local/share/fonts</code> ==== <!--T:58--></translate> | <translate> | ||
===== Solution 2: Symlink to system fonts at <code>$HOME/.local/share/fonts</code> =====<!--T:58--> | |||
</translate> | |||
<translate><!--T:59--> <blockquote>'''Note:''' this method doesn't work for some flatpak applications (for example, steam)! </translate> | <translate><!--T:59--> <blockquote>'''Note:''' this method doesn't work for some flatpak applications (for example, steam)! </translate> | ||
| Line 339: | Line 346: | ||
<translate> | <translate> | ||
===== Option 1: Allow access to the fonts folder and <code>/nix/store</code> ===== <!--T:61--> | ====== Option 1: Allow access to the fonts folder and <code>/nix/store</code> ======<!--T:61--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 358: | Line 365: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate>===== Option 2: Allow access to the WHOLE filesystem ===== <!--T:64--></translate> | <translate> | ||
====== Option 2: Allow access to the WHOLE filesystem ======<!--T:64--> | |||
</translate> | |||
<translate> | <translate> | ||
<!--T:65--> | <!--T:65--> | ||
| Line 371: | Line 380: | ||
<!--T:66--> | <!--T:66--> | ||
It is important to keep in mind that some flatpak apps may refuse to launch if given certain permissions, such as the Steam flatpak. | It is important to keep in mind that some flatpak apps may refuse to launch if given certain permissions, such as the Steam flatpak. | ||
</translate> | </translate> | ||