GNU bug report logs - #57963
[PATCH 0/1] Support user's fontconfig.

Previous Next

Package: guix-patches;

Reported by: Taiju HIGASHI <higashi <at> taiju.info>

Date: Wed, 21 Sep 2022 00:28:02 UTC

Severity: normal

Tags: patch

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Taiju HIGASHI <higashi <at> taiju.info>
To: guix-patches <at> gnu.org
Cc: Taiju HIGASHI <higashi <at> taiju.info>
Subject: [PATCH 0/1] Support user's fontconfig.
Date: Wed, 21 Sep 2022 09:27:20 +0900
Hi,

I want to add custom fontconfig, so I've implemented the ability of custom
font configuration to fontutils.

It allows us to set up our fontconfig as follows.

    (home-environment
     (packages (list font-google-noto))
     (services
      (list
       (simple-service 'my-fontconfig-service
                       home-fontconfig-service-type
                       (list
                        "<alias>
      <family>sans-serif</family>
      <prefer>
        <family>Noto Sans CJK JP</family>
      </prefer>
    </alias>"
                        "<alias>
      <family>sans-serif</family>
      <prefer>
        <family>Noto Serif CJK JP</family>
      </prefer>
    </alias>")))))

Of course, we can also use SXML!

    (define font-family-map
      '((sans-serif . "Noto Sans CJK JP")
        (serif . "Noto Serif CJK JP")))

    (home-environment
     (packages (list font-google-noto))
     (services
      (list
       (simple-service 'my-fontconfig-service
                       home-fontconfig-service-type
                       (list
                        (call-with-output-string
                          (lambda (port)
                            (sxml->xml
                             (map (lambda (pair)
                                    `(alias
                                      (family ,(car pair))
                                      (prefer
                                       (family ,(cdr pair)))))
                                  font-family-map)
                             port))))))))

Taiju HIGASHI (1):
  home: fontutils: Support user's fontconfig.

 gnu/home/services/fontutils.scm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

--
2.37.3




This bug report was last modified 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.