unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Todor Kondić" <tk.code@protonmail.com>
To: "help-guix\\@gnu.org" <help-guix@gnu.org>
Subject: Fonts do not work with multiple profiles (fontconfig) and a proposed workaround
Date: Tue, 29 Sep 2020 14:30:52 +0000	[thread overview]
Message-ID: <F1I9afyPO1ownvrS4PzLmUWXiopRyvVPyD0oHZN2MdqVeWHPCEKK2M3r-UUr3yxSqwnlxkqg0nJbcMwNUCISnF-Ikncn8hmL6doRQeX0cnQ=@protonmail.com> (raw)

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


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>/gnu/store/7y3lvk3xf4im8n44337mc6y0ccysvfia-font-dejavu-2.37/share/fonts</dir>
	<dir>~/.guix-profile/share/fonts</dir> <dir>/run/current-system/profile/share/fonts</dir>
	<dir prefix="xdg">fonts</dir>
	<!-- the following element will be removed in the future -->
	<dir>~/.fonts</dir>
---------------------------

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 file,
----------------------------
<!--
  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" prefix="xdg">fontconfig/fonts.conf</include>
	<!-- 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 -->
<fontconfig>
	<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
		<its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
	</its:rules>

	<description>Default configuration file</description>


<!-- Font directory list -->
        <dir>~/.guix-pillars/pillar/share/fonts</dir>

</fontconfig>

------------------------------

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)!

T






             reply	other threads:[~2020-09-29 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 14:30 Todor Kondić [this message]
2020-09-30  7:59 ` Fonts do not work with multiple profiles (fontconfig) and a proposed workaround Pierre Neidhardt
2020-09-30  8:21   ` Todor Kondić
2020-12-17 20:41     ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='F1I9afyPO1ownvrS4PzLmUWXiopRyvVPyD0oHZN2MdqVeWHPCEKK2M3r-UUr3yxSqwnlxkqg0nJbcMwNUCISnF-Ikncn8hmL6doRQeX0cnQ=@protonmail.com' \
    --to=tk.code@protonmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).