From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Kozlov Subject: Making the core fonts work Date: Fri, 14 Feb 2020 09:44:16 +0300 Message-ID: <21346771581662656@myt5-bc0f9d8e5f27.qloud-c.yandex.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2Ui8-0001nx-Er for guix-devel@gnu.org; Fri, 14 Feb 2020 01:44:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2Ui6-0005VP-L7 for guix-devel@gnu.org; Fri, 14 Feb 2020 01:44:23 -0500 Received: from forward101p.mail.yandex.net ([77.88.28.101]:54797) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2Ui6-0005Qs-00 for guix-devel@gnu.org; Fri, 14 Feb 2020 01:44:22 -0500 Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 31CCC328100D for ; Fri, 14 Feb 2020 09:44:17 +0300 (MSK) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel Hello. You should know that it is currently non-trivial to make the X.org server= use fonts from a profile. You basically have to manually sift through th= e font files and find their =E2=80=98dirname=E2=80=99. The =E2=80=98fonts= -dir=E2=80=99 union directories that Guix generates and installs into pro= files have been useless since forever and in fact only get in the way; th= is is because the X.org server will not follow symbolic links to font fil= es. I was reading the Xserver(1) man page and noticed that it supports =E2=80= =98font catalogue=E2=80=99 directories. They should contain symbolic link= s to actual font directories that will be added to the font path. This sh= ould allow a very nice solution. Something like this: (define (fontpath-file manifest) (define build #~(begin (use-modules (srfi srfi-1) (srfi srfi-26) (guix build utils)) (let* ((top-font-dirs (filter file-exists? (map (cut string-append <> "/share/fonts") '#$(manifest-inputs manifest))= )) (font-dirs (append-map (lambda (dir) (find-files dir (lambda (file stat) (and (eq? 'director= y (stat:type stat)) (file-exists? = (string-append file "/fonts.dir")))) #:directories? #t)) t= op-font-dirs))) (mkdir #$output) (chdir #$output) (if (null? font-dirs) (exit #t) (for-each (lambda (dir pri) (symlink dir (string-append (basename dir) ":pr= i=3D" pri))) font-dirs (map number->string (iota (length font-dirs) 1)))= )))) (gexp->derivation "fontpath.d" build #:modules '((guix build utils) (srfi srfi-1) (srfi srfi-26)) #:local-build? #t #:substitutable? #f #:properties `((type . profile-hook) (hook . fontpath-dir)))) This should be installed somewhere in the profile. Then you set the font = path to "catalogue:$HOME/.guix-profile/share/fontpath.d" and everything w= orks like a charm. I am unqualified to make the actual patch that would add this functionali= ty into Guix.