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 #65 received at 57963 <at> debbugs.gnu.org (full text, mbox):

From: Taiju HIGASHI <higashi <at> taiju.info>
To: 57963 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, liliana.prikler <at> gmail.com, andrew <at> trop.in
Subject: Re: [PATCH v3] home: fontutils: Support user's fontconfig.
Date: Tue, 27 Sep 2022 19:10:34 +0900
Hi,

I just sent you the v3 patch.

I have changed only the interface of `preferred-defalut-font` slightly
from what I suggested the other day.

We configure the service as follows.

--8<---------------cut here---------------start------------->8---
  (simple-service
    'my-fontconfig-service
    home-fontconfig-service-type
    (home-fontconfig-configuration
     (font-directories
      (list "~/fonts"))
     (preferred-default-font
      (default-font
        (serif "Noto Serif CJK JP")
        (sans-serif "Noto Sans CJK JP")
        (monospace "PlemolJP Console")))
     (extra-config
      `((match (@ (target font))
          (edit (@ (mode assign)
                   (name antialias))
                (bool true)))))))
--8<---------------cut here---------------end--------------->8---

I didn't understand it properly, but `home-fontconfig-service-type` is
pre-registered as `essential-services` and needs to be extended using
`simple-service`.

> +(define (home-fontconfig-extend original-config extend-configs)
> +  (home-fontconfig-configuration
> +   (inherit original-config)
> +   (font-directories
> +    (append
> +        (home-fontconfig-configuration-font-directories original-config)
> +        (append-map home-fontconfig-configuration-font-directories extend-configs)))
> +   (preferred-default-font
> +    (home-fontconfig-configuration-preferred-default-font
> +     (if (null? extend-configs)
> +         original-config
> +         (last extend-configs))))

This is the part I am most concerned about, not sure if replacing the
preferred-default-font setting with the last setting is the proper way
to go about it.

I wanted to write a test as well, but since it was to be handled by
gexp, I could not figure out how to write a test that would validate the
gexp result using only exported methods. (I would like to write tests
for serialized functions that are private functions.)

Cheers,
-- 
Taiju




This bug report was last modified 215 days ago.

Previous Next


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