[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fonts do not work with multiple profiles (fontconfig) and a proposed wor

From: Todor Kondić
Subject: Fonts do not work with multiple profiles (fontconfig) and a proposed workaround
Date: Tue, 29 Sep 2020 14:30:52 +0000

Here's my experience with guix-as-a-package-manager, fontconfig and multiple 

If fonts are installed in a profile different than the default one, 
applications do not pick them up out of the box. I.e. icecat shows characters 
as squares and you cannot select a cool non standard font in your GTK Emacs.

After digging into this matter, I concluded that the culprit is the main config 
file situated in some-nondefault-guix-profile/etc/fonts/fonts.conf

Here's a snippet:
<!-- Font directory list -->

        <dir prefix="xdg">fonts</dir>
        <!-- the following element will be removed in the future -->

Clearly, some-nondefault-guix-profile/share/fonts is not among the list of dirs 
that are searched for font definitions. I'd call this a bug, but maybe it's by 
design. Still, shouldn't guix package definitions respect the -p flag to 
package command?

Anyway, the workaround is the following. See this snippet of the same config 
  Load local system customization file
        <include ignore_missing="yes">conf.d</include>

<!-- Font cache directory list -->

This means it includes the conf files in ...profile/etc/conf.d. The README file 
reveals that 5?-*.conf files are used for additional customisation. This makes 
50-user.conf particularly interesting. And, here it is ...

<include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>
        <include ignore_missing="yes" 
        <!-- the following elements will be removed in the future -->
        <include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>
        <include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>

Apparently , ~/.config/fontconfig/fonts.conf (xdg prefix being ~/.config) is 
the place to add some more config

After creating ~/.config/fontconfig/fonts.conf with the following content

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
        <its:rules xmlns:its=""; version="1.0">
                <its:translateRule translate="no" 

        <description>Default configuration file</description>

<!-- Font directory list -->



and running fc-cache -rvf the fontconfig-aware programs were able to select 
fonts from the non-default guix profile.

Hope this helps (me again in six monts from now)!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]