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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Taiju HIGASHI <higashi@HIDDEN>; Keywords: patch; dated Wed, 21 Sep 2022 00:28:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 24 Sep 2022 15:52:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 24 11:52:11 2022
Received: from localhost ([127.0.0.1]:45016 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oc7Rr-0000J4-AI
	for submit <at> debbugs.gnu.org; Sat, 24 Sep 2022 11:52:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58534)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1oc7Ro-0000Il-SK
 for 57963 <at> debbugs.gnu.org; Sat, 24 Sep 2022 11:52:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38076)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1oc7Rj-0005dg-B1; Sat, 24 Sep 2022 11:52:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=hILSlAEIsp+ZtoWmiW2qW47xO6Cn7DGJmcUAxQfHE1I=; b=fXgF6NhXurJ3hVR+Ss6T
 5Jjh2hUz+1XKxRcjGbwD2oz+7FPI/uonRlijddC6qGmwdQKW0FfIqN6g/C8vh2eIkwOekrNphJ0cC
 al3Lw/RFCAuY3PzeXNDiVfsPCst3QvW0RV6M5mhjOBNcQYhisIZg15cks+DW0IpXVfj/0FL1eHYpO
 fVDFAHgcN/riZfIv+kcBn405UiPBqhxDKI1bD3qqF4fz3Soy+3ppUTwZzXl0mDnu/2m8NPYySkJzv
 n0FCW9ScIgSVN5c83zwZYjIOploXA4fJfs+pGaqQwRdifdAXWNxw7aTTixe32pTuiBdDIeEyu3rpd
 lZYyRupKjtyFjA==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58752
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1oc7Ri-00017X-Tx; Sat, 24 Sep 2022 11:52:03 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Taiju HIGASHI <higashi@HIDDEN>
Subject: Re: bug#57963: [PATCH 0/1] Support user's fontconfig.
References: <20220921002721.23511-1-higashi@HIDDEN>
 <20220922012033.30835-1-higashi@HIDDEN> <87pmfoq6kt.fsf@HIDDEN>
 <87sfkjiyck.fsf@HIDDEN> <875yhfwxe9.fsf@HIDDEN>
Date: Sat, 24 Sep 2022 17:52:01 +0200
In-Reply-To: <875yhfwxe9.fsf@HIDDEN> (Taiju HIGASHI's message of "Thu, 22
 Sep 2022 18:50:38 +0900")
Message-ID: <871qs093dq.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>,
 Andrew Tropin <andrew@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Taiju HIGASHI <higashi@HIDDEN> skribis:

> I'm not very knowledgeable about G-Expressions, so I don't understand
> much of what you replied. (I will study it!).

I didn=E2=80=99t mention gexps.  :-)

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
> My motivation for writing this patch is that I wanted to continue to use
> the settings in the following file after switching to Guix Home.
>
> https://git.sr.ht/~taiju/taix/tree/31a37c231ebba60e38f7fa9cfe1c7a5d7362d0=
21/item/dotfiles/fontconfig/.config/fontconfig/fonts.conf
>
> Honestly, I don't know why it is so complicated, but I refered it from
> the following ArchWiki content.
>
> https://wiki.archlinux.org/title/Font_configuration/Examples#Japanese
>
> Therefore, just being able to set font aliasing is unfortunately not
> enough to satisfy my use case.

Oh I see.  Do you need every single bit from the =E2=80=98fonts.conf=E2=80=
=99 file
above?

Anyway, it does look like your v2 is the way to go, with the obvious
caveat that using it is tricky: one needs to know about fontconfig=E2=80=99s
config file format and about sxml.

Maybe we can go with v2 for now (it provides a useful =E2=80=9Cescape hatch=
=E2=80=9D)
but prepare for more conventional configuration bindings?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 23 Sep 2022 07:20:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 23 03:20:14 2022
Received: from localhost ([127.0.0.1]:39251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obcyr-0002Xy-Td
	for submit <at> debbugs.gnu.org; Fri, 23 Sep 2022 03:20:14 -0400
Received: from mailrelay.tugraz.at ([129.27.2.202]:18531)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1obcyp-0002Xk-CQ
 for 57963 <at> debbugs.gnu.org; Fri, 23 Sep 2022 03:20:12 -0400
Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101])
 by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4MYk7W0rTkz3wXG;
 Fri, 23 Sep 2022 09:20:06 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at;
 s=mailrelay; t=1663917607;
 bh=jweejWx50Zxt/PImzkSZUsfCl2WUCRjtrgTOASkkvG8=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=j/lw5/mCM/PcBMUFMyzYFi/8GvRDbzAm/tgE+DfZizc8Je6JQVu/0SLD/rcXYQXvp
 T/PNIp9rMgM6fPeTro5m9dTkidcaMp7ho/U1PKvy/dRqtnrRf1hTc5uA5id2OVJUki
 IDojqj4klfijRjk5/anVwGfb2meY/LlN4IeeQqpg=
Message-ID: <8337bfeb95dffbbe171f706c1fbc36d12658d0f6.camel@HIDDEN>
Subject: Re: [PATCH 1/1] home: fontutils: Support user's fontconfig.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Taiju HIGASHI <higashi@HIDDEN>
Date: Fri, 23 Sep 2022 09:20:05 +0200
In-Reply-To: <87leqcw63n.fsf@HIDDEN>
References: <20220921002921.23631-2-higashi@HIDDEN>
 <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
 <871qs5xd30.fsf@HIDDEN>
 <65da0cdb245fe2bcd99589d4fb1a9eb785a1b527.camel@HIDDEN>
 <87leqcw63n.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.45.3 
MIME-Version: 1.0
X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ
X-Spam-Scanner: SpamAssassin 3.003001 
X-Spam-Score-relay: -1.9
X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Am Donnerstag, dem 22.09.2022 um 10:27 +0900 schrieb Taiju HIGASHI:
> I also wrote a test but did not include it in the patch because I
> thought it would be a technical debt.
> I'm attaching that as a reference.
Added tests are always welcome.




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 22 Sep 2022 09:50:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 22 05:50:50 2022
Received: from localhost ([127.0.0.1]:36444 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obIr3-0002ZV-PY
	for submit <at> debbugs.gnu.org; Thu, 22 Sep 2022 05:50:50 -0400
Received: from mail-pg1-f181.google.com ([209.85.215.181]:39816)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1obIr1-0002ZI-Ug
 for 57963 <at> debbugs.gnu.org; Thu, 22 Sep 2022 05:50:48 -0400
Received: by mail-pg1-f181.google.com with SMTP id b5so456293pgb.6
 for <57963 <at> debbugs.gnu.org>; Thu, 22 Sep 2022 02:50:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject
 :date; bh=D4dvu1qaCqOjxj8BT9V6pcem4rjBEAy8fTV5CM4Ttgk=;
 b=pN+FlG0Q3Ov1/1BQFUodRYkWYC+8pcSa9roETY8CaXc43IrUvNgQ8C54sxSB0Xd4Ll
 QA1Wt2dfGyTiZMRhhLshunjsdJ8AswIlv/wHsf41uyHp1oCsAxilaTSIYc8qRPPMiZqK
 NXRi5DtqHtLj0Yi8c2k2BguYEgFcYPyTCV6LC3Ce+WhnRJ+zahPzVscakjHEMQE59UZn
 NypZFf5s1hZw7k5KvwDP+s7mgAwhBNG74U3ci6PFeF7f7Rn7TxaHfWvjpsQJyVwLMxM/
 hGKioSHna3nr6dMGOk4PO2tR4dnZOf+HsuUBzqvPyFyBJLugFN2E/SvvH8klx7nWiWLs
 KW0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state
 :from:to:cc:subject:date;
 bh=D4dvu1qaCqOjxj8BT9V6pcem4rjBEAy8fTV5CM4Ttgk=;
 b=O7mDF42o8HbgQlW/rQSboPnVTNF7+Jb2Z+zWzfnlEH4n4XJmEspEFhiAHfvrEtJaJ0
 o5JLqRX9hmd7U+Ii52STJTPaId3ldbDNX0hzwm4n1ZBzioUHC+1UZstSvHH5+rPVGXSh
 DvxHF9XPNhuvU/d5Jsbul6d7kcsLgbkzqoFux7CxmYMYm4cuYucdOo/zF78SO61cltY9
 OdDDbhlitRCLJcOQnk1xDRrPitZx1hmsh/kPPHjiKWpdt3bSpLikcwmfcpEHVHU1P986
 Eoses1gc2JzpQqioEL99j927Nj9neAcdILgSarcKTDDGLU5YlLsvwRlwFoYqk7CTIHsQ
 XSmA==
X-Gm-Message-State: ACrzQf0qoAKkrtnG2KkLPAEm643kXSYqAIQXEoAD/1ZllJVRkGhhloyt
 cXpcBYW3ThRbLzxi/aqQ8mo5yg==
X-Google-Smtp-Source: AMsMyM56d4Ew7WgBqM20m0MtfLSFX5NDtHAFJyhLKT/srOMPS2Mtg/mEaL0YtCj2idFF7odDs+h7sw==
X-Received: by 2002:a63:ff5a:0:b0:42c:61f:b81 with SMTP id
 s26-20020a63ff5a000000b0042c061f0b81mr2308403pgk.254.1663840242001; 
 Thu, 22 Sep 2022 02:50:42 -0700 (PDT)
Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 17-20020a170902e9d100b001755e4278a6sm3549521plk.261.2022.09.22.02.50.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Sep 2022 02:50:41 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: Andrew Tropin <andrew@HIDDEN>, Ludovic =?iso-8859-1?Q?Court=E8s?=
 <ludo@HIDDEN>
Subject: Re: [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig.
References: <20220921002721.23511-1-higashi@HIDDEN>
 <20220922012033.30835-1-higashi@HIDDEN> <87pmfoq6kt.fsf@HIDDEN>
 <87sfkjiyck.fsf@HIDDEN>
Date: Thu, 22 Sep 2022 18:50:38 +0900
In-Reply-To: <87sfkjiyck.fsf@HIDDEN> ("Ludovic =?iso-8859-1?Q?Court=E8s?=
 =?iso-8859-1?Q?=22's?= message of "Thu, 22
 Sep 2022 10:53:47 +0200")
Message-ID: <875yhfwxe9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Andrew and Ludovic,

Thanks for your input and background on the code style.

I'm not very knowledgeable about G-Expressions, so I don't understand
much of what you replied. (I will study it!).

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hi Andrew,
>
> Andrew Tropin <andrew@HIDDEN> skribis:
>
>> 2. We had a discussion with Ludovic about rde home services vs guix home
>> services styles.  And this one looks like rde style, not guix.
>>
>> rde takes arbitrary s-exps and g-exps with optional structure checks and
>> serializes them to target format.
>>
>> guix uses nested records with rigid nesting structure.
>
> That=E2=80=99s generally true, but it=E2=80=99s not black and white and t=
here=E2=80=99s room for
> discussion.  :-)
>
> In this case, Taiju=E2=80=99s proposal is to let users write snippets lik=
e this:
>
>     (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))))))))
>
> (With v2 they=E2=80=99d provide SXML instead of XML-in-a-string, so it=E2=
=80=99s
> slightly less verbose but quite similar.)
>
> In this particular case, I would find it easier to use if one could
> provide a set of <font-alias> records, let=E2=80=99s say along these line=
s:
>
>   (simple-service 'my-fontconfig-service
>                   home-fontconfig-service-type
>                   (list (font-alias 'sans-serif "Noto Sans CJK JP") =E2=
=80=A6))
>
> That way, users wouldn=E2=80=99t need to know the details of the XML synt=
ax for
> fontconfig.
>
> The downside is that it restricts what can be done: it lets you add font
> aliases, but nothing more.
>
> Do you have other use cases in mind, Taiju?

My motivation for writing this patch is that I wanted to continue to use
the settings in the following file after switching to Guix Home.

https://git.sr.ht/~taiju/taix/tree/31a37c231ebba60e38f7fa9cfe1c7a5d7362d021=
/item/dotfiles/fontconfig/.config/fontconfig/fonts.conf

Honestly, I don't know why it is so complicated, but I refered it from
the following ArchWiki content.

https://wiki.archlinux.org/title/Font_configuration/Examples#Japanese

Therefore, just being able to set font aliasing is unfortunately not
enough to satisfy my use case.

Thanks,
--
Taiju




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 22 Sep 2022 08:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 22 04:53:59 2022
Received: from localhost ([127.0.0.1]:36320 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obHy3-0007Hq-H0
	for submit <at> debbugs.gnu.org; Thu, 22 Sep 2022 04:53:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37694)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1obHy1-0007Hd-Pm
 for 57963 <at> debbugs.gnu.org; Thu, 22 Sep 2022 04:53:59 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50598)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1obHxu-00041I-WC; Thu, 22 Sep 2022 04:53:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=/zlhUtB6Uw9consf16MKCK1Ab7s2tWue51KxkCiGBqY=; b=Ngnsor+Zr67OSdmqRpHN
 Qc4icXZXKE4yJWISCc1ueZpAde3H6abqpTRWDTZlaKspW+eGSgNSOq1RU1Fcx0glxGOItDbs7xFe5
 9cpdk0Is44Lv39USI975F+Ccbus44Z5hNiCh0WKXONt1n7y80ZjG6vBtDuFHfd4UOyp+fQWW9HYW6
 Jjk4sNGJ8SlPQxiOItTMBTLIdbpiHEfl1NVkhoH1ErWt1Xd+X7a0uD8siPumkVDE/6KssgD2emkdf
 AbsnGvf0bJGFWKI8F+TzlrdAsdcCU0DYGSJ0d2OZ5qBimD27lNZMaG0+ydCsdB1Yr02HLlymqJG3c
 9hUwMTOrzQV5fQ==;
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=57702 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1obHxu-0007Hu-Hz; Thu, 22 Sep 2022 04:53:50 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Andrew Tropin <andrew@HIDDEN>, Taiju HIGASHI <higashi@HIDDEN>
Subject: Re: [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig.
References: <20220921002721.23511-1-higashi@HIDDEN>
 <20220922012033.30835-1-higashi@HIDDEN> <87pmfoq6kt.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Primidi 1 =?utf-8?Q?Vend=C3=A9miaire?= an 231 de la
 =?utf-8?Q?R=C3=A9volution=2C?= jour du Raisin
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Thu, 22 Sep 2022 10:53:47 +0200
In-Reply-To: <87pmfoq6kt.fsf@HIDDEN> (Andrew Tropin's message of "Thu, 22 Sep
 2022 09:14:10 +0300")
Message-ID: <87sfkjiyck.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Andrew,

Andrew Tropin <andrew@HIDDEN> skribis:

> 2. We had a discussion with Ludovic about rde home services vs guix home
> services styles.  And this one looks like rde style, not guix.
>
> rde takes arbitrary s-exps and g-exps with optional structure checks and
> serializes them to target format.
>
> guix uses nested records with rigid nesting structure.

That=E2=80=99s generally true, but it=E2=80=99s not black and white and the=
re=E2=80=99s room for
discussion.  :-)

In this case, Taiju=E2=80=99s proposal is to let users write snippets like =
this:

--8<---------------cut here---------------start------------->8---
    (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))))))))
--8<---------------cut here---------------end--------------->8---

(With v2 they=E2=80=99d provide SXML instead of XML-in-a-string, so it=E2=
=80=99s
slightly less verbose but quite similar.)

In this particular case, I would find it easier to use if one could
provide a set of <font-alias> records, let=E2=80=99s say along these lines:

  (simple-service 'my-fontconfig-service
                  home-fontconfig-service-type
                  (list (font-alias 'sans-serif "Noto Sans CJK JP") =E2=80=
=A6))

That way, users wouldn=E2=80=99t need to know the details of the XML syntax=
 for
fontconfig.

The downside is that it restricts what can be done: it lets you add font
aliases, but nothing more.

Do you have other use cases in mind, Taiju?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 22 Sep 2022 06:14:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 22 02:14:23 2022
Received: from localhost ([127.0.0.1]:35880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obFTb-000748-Do
	for submit <at> debbugs.gnu.org; Thu, 22 Sep 2022 02:14:23 -0400
Received: from relay10.mail.gandi.net ([217.70.178.230]:36431)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrew@HIDDEN>) id 1obFTY-00073t-Vg
 for 57963 <at> debbugs.gnu.org; Thu, 22 Sep 2022 02:14:22 -0400
Received: (Authenticated sender: andrew@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id BBB1E240002;
 Thu, 22 Sep 2022 06:14:13 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1;
 t=1663827254;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=6KE27D7zhunqEKYwJfdq8mYnaZw0IQ+DnubKJYfU+L0=;
 b=oSGh3I5vmnxdIUZnU0E4eYAQqKlLqV+v/0sSSEyOgZDtDqvKxwBRhDXP+Gnl8gCZZSjT+g
 F1/KxJV5YB+xt2RLs11VYuOKy3SxWqmfgzzwXJ1pRIBxkswFulPFU6uUEbXKqunkroRuum
 L0D/fyXiCT7KHIVKMNm7EYo2HkCwAcLKaiIbn3FBVmwnHV1PLn/8aV2Jd9btJ3uXG4HIK9
 nLJKjgrMkbNeB75l4mdH1VgMYld3k8xKlNxxgpgGqDOuQUKeAfDuxpuaUjORUXjrPxfkS7
 Jom800iDl9YKR9t/1h3r9/XYINm0Oo8pqiQJHWvovY3M20IzVAuxF5PKN+Xp0w==
From: Andrew Tropin <andrew@HIDDEN>
To: Taiju HIGASHI <higashi@HIDDEN>, 57963 <at> debbugs.gnu.org
Subject: Re: [bug#57963] [PATCH v2] home: fontutils: Support user's fontconfig.
In-Reply-To: <20220922012033.30835-1-higashi@HIDDEN>
References: <20220921002721.23511-1-higashi@HIDDEN>
 <20220922012033.30835-1-higashi@HIDDEN>
Date: Thu, 22 Sep 2022 09:14:10 +0300
Message-ID: <87pmfoq6kt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 2022-09-22 10:20,
 Taiju HIGASHI wrote: > * gnu/home/services/fontutils.scm
 (add-fontconfig-config-file): Support user's > fontconfig. > --- >
 gnu/home/services/fontutils.scm
 | 29 ++++++++++++++++++++++++----- > 1 file changed, 24 insertion [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [217.70.178.230 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
X-Debbugs-Envelope-To: 57963
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 2022-09-22 10:20, Taiju HIGASHI wrote:

> * gnu/home/services/fontutils.scm (add-fontconfig-config-file): Support u=
ser's
> fontconfig.
> ---
>  gnu/home/services/fontutils.scm | 29 ++++++++++++++++++++++++-----
>  1 file changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutil=
s.scm
> index 6062eaed6a..b57cccbaae 100644
> --- a/gnu/home/services/fontutils.scm
> +++ b/gnu/home/services/fontutils.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright =C2=A9 2021 Andrew Tropin <andrew@HIDDEN>
>  ;;; Copyright =C2=A9 2021 Xinglu Chen <public@HIDDEN>
> +;;; Copyright =C2=A9 2022 Taiju HIGASHI <higashi@HIDDEN>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -21,6 +22,9 @@ (define-module (gnu home services fontutils)
>    #:use-module (gnu home services)
>    #:use-module (gnu packages fontutils)
>    #:use-module (guix gexp)
> +  #:use-module (srfi srfi-1)
> +  #:use-module (sxml simple)
> +  #:use-module (ice-9 match)
>=20=20
>    #:export (home-fontconfig-service-type))
>=20=20
> @@ -33,15 +37,28 @@ (define-module (gnu home services fontutils)
>  ;;;
>  ;;; Code:
>=20=20
> -(define (add-fontconfig-config-file he-symlink-path)
> +(define (parse-extra-user-config extra-user-config)
> +  (map (match-lambda
> +         ((? pair? sxml) sxml)
> +         ((? string? xml) (xml->sxml xml))
> +         (_ (error "extra-user-config must be xml string or sxml.")))
> +       extra-user-config))
> +
> +(define (add-fontconfig-config-file extra-user-config)
>    `(("fontconfig/fonts.conf"
>       ,(mixed-text-file
>         "fonts.conf"
>         "<?xml version=3D'1.0'?>
>  <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> -<fontconfig>
> -  <dir>~/.guix-home/profile/share/fonts</dir>
> -</fontconfig>"))))
> +"
> +       (call-with-output-string
> +         (lambda (port)
> +           (sxml->xml
> +            `(fontconfig
> +              (dir "~/.guix-home/profile/share/fonts")
> +              ,@(parse-extra-user-config extra-user-config))
> +            port)
> +           (newline port)))))))
>=20=20
>  (define (regenerate-font-cache-gexp _)
>    `(("profile/share/fonts"
> @@ -49,6 +66,8 @@ (define (regenerate-font-cache-gexp _)
>=20=20
>  (define home-fontconfig-service-type
>    (service-type (name 'home-fontconfig)
> +                (compose concatenate)
> +                (extend append)
>                  (extensions
>                   (list (service-extension
>                          home-xdg-configuration-files-service-type
> @@ -59,7 +78,7 @@ (define home-fontconfig-service-type
>                         (service-extension
>                          home-profile-service-type
>                          (const (list fontconfig)))))
> -                (default-value #f)
> +                (default-value '())
>                  (description
>                   "Provides configuration file for fontconfig and make
>  fc-* utilities aware of font packages installed in Guix Home's profile."=
)))

I like the current approach, but I have two concerns:

1. Serialization happens on client side, not daemon side (during the
build), thus it doesn't support gexp and file-likes, so it would be hard
to append part of already existing file to the config or do similiar thing.

2. We had a discussion with Ludovic about rde home services vs guix home
services styles.  And this one looks like rde style, not guix.

rde takes arbitrary s-exps and g-exps with optional structure checks and
serializes them to target format.

guix uses nested records with rigid nesting structure.

rde services style examples:
https://git.sr.ht/~abcdw/rde/tree/8ec99884fad18a80a08a7c1d6a7cf46a006327c4/=
rde/home/services/wm.scm#L145
https://git.sr.ht/~abcdw/rde/tree/8ec99884fad18a80a08a7c1d6a7cf46a006327c4/=
rde/home/services/xdisorg.scm#L55

guix services style examples:
https://guix.gnu.org/manual/devel/en/guix.html#Web-Services

Related discussions:
https://issues.guix.gnu.org/53466
https://issues.guix.gnu.org/52698
https://yhetil.org/guix-devel/87h79qx5db.fsf@HIDDEN/

To sum up, personally I like and prefer the configuration style from
this patch, but to keep it consistent with guix system services we need
to use guix style.

=2D-=20
Best regards,
Andrew Tropin

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmMr/TIACgkQIgjSCVjB
3rCDDxAAkwi5UxtFBWaGU+WrzUdSxp5ClXpCM1kfHD8XSI2dMEQJbz7YGXQ7f7MD
hwv7489dQcDkqjwFYr6hTTMyicqemrnhi9OIg2rInp8UO83DwLCkZaJP0KVc8/mH
NpB0IaOn1hNqMjHnsgja79PLGXw+wBVrWOxTSVci3QfMv7DzO5E3abrqEzB6LuYR
xOWprV8r3/WttKLoRQ5LD113WbrDdITUrAa2Cs0yZi+bRdAEqw7jz99riqJukpnb
F2zOj5RZUkWq75cTpHCkg7DnB6iASLbMvKvJXnqYr9Yeja1w4XOmzw4Rf3DVdu15
UdiaUGwyWzuaQh61vxlVFCnJ2RQwaFL0/ClXfNH3L7ORmTbvJJT2FXhly3Nxaebn
koxWOSC2NK+PwV0WfaIoEeefT6l/FGZfhuRavSb6nKlQhgUxAnzwSjCVHGV1a94S
kNsagP23PeVtpN+vtTWdoSCKLW1xzGN8ozbrCTDfOdUiw0m1nNLrHnVgc077gjFZ
zVaQC5cmSXkpvJy7cydEEQC7erIf5BIdfbf94DP2mKmiGb1TmV5g/DY+3GEK//WS
wJiV+AdhaboAOufX9Xd/WI6ruEydHQANIUf7Yl9la05loJLTsCZ7kSsjLHfMJOCD
8QuXnZKn6weoL6YPvpgL8HCbV1WaOOvQ6h0Q5gX6JvFTiUb5Cn8=
=uFxI
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 22 Sep 2022 01:28:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 21:28:10 2022
Received: from localhost ([127.0.0.1]:35523 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obB0c-0005Q4-46
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 21:28:10 -0400
Received: from mail-pg1-f179.google.com ([209.85.215.179]:47048)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1obB0Y-0005PX-P9
 for 57963 <at> debbugs.gnu.org; Wed, 21 Sep 2022 21:28:07 -0400
Received: by mail-pg1-f179.google.com with SMTP id 78so7652300pgb.13
 for <57963 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 18:28:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=mime-version:user-agent:message-id:in-reply-to:date:references
 :subject:cc:to:from:from:to:cc:subject:date;
 bh=z1f3JQHwL3jgd/0xICnyBF+2/k9bcuH1wojBbH9YdLs=;
 b=0YqYpt1x3GtLaSEKV4eZTmzwtte5J3on1gZqiLB5IRDk4U7LO6KJk7hTkyUaUfOOuN
 2ldSFMqoajGc9NfVKQtEXD5vzZZrrinMApEbgXD18WbbJAI1Vje+xTywsBA1T+OKv1sj
 qmwcZsQ2PwzIzLl3INd86yi/nMJ8Pqt7OLQ97QhVW6hItJFPDkv2j7jSDTl5CVtV96YH
 Iav/eOhPS5lYq1p9JhcKpZ8Hh8nMODg+zaXSC0G56tjIlxxYamgXsVqwhyIw1DTNUHZm
 1DGKnzNv9gGrE8Dr294p8XrUspgfPlRieDYpbmSULSmy8sclJR3Ti4ERi6N6JMrBHMee
 iaHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:in-reply-to:date:references
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=z1f3JQHwL3jgd/0xICnyBF+2/k9bcuH1wojBbH9YdLs=;
 b=AynDcsDby1CqpGJ/wGxgRa5x697DnF6OPwGa5Cj21Nm42PBEf5GOpy1lyiCVjr2/DA
 v1a0xgngv4CwvqnofmjAT+zzt5cFR7IAghjhFEATavUJg3lH+cDyqSQKCsRO4NOMmxsR
 ebtyackDf+FuckiPjY2T8s1kLd8K4/5df13N0EO2vt9idyhfd7T1eW3J5zjaQCkT9Rm9
 6EkxD8qHigYpvDOytkp316/n7GHWkVkl8GRUW0WaixOZrawUc1AQNnZYNkDwvnMi6Yu7
 yIDax5V4p5ZoWVUjOX8cBF5rDIjVDoIP4ja3XSMLFNqfWEC7PvffQ+xfbDcO6kg96Tyh
 H+Yw==
X-Gm-Message-State: ACrzQf28E9TIo7zpYa7zE69J1VIPgAAhSwmx4Gd16arnuwidFaGrh41Y
 Zaek6MjJKevNmEIzpjDw7tqx+mTxT5UTrTLc
X-Google-Smtp-Source: AMsMyM7IVZqZDqnl8zNxK9/6udqK5QhWe5GMQ7KBundRDHM1AMVKdF2CZksFS1OvchaldycL6VdPoQ==
X-Received: by 2002:a63:f806:0:b0:439:d86e:1f6e with SMTP id
 n6-20020a63f806000000b00439d86e1f6emr934541pgh.46.1663810080630; 
 Wed, 21 Sep 2022 18:28:00 -0700 (PDT)
Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 b15-20020a63d30f000000b004393cb720afsm2583462pgg.38.2022.09.21.18.27.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Sep 2022 18:28:00 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: [PATCH 1/1] home: fontutils: Support user's fontconfig.
References: <20220921002921.23631-2-higashi@HIDDEN>
 <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
 <871qs5xd30.fsf@HIDDEN>
 <65da0cdb245fe2bcd99589d4fb1a9eb785a1b527.camel@HIDDEN>
Date: Thu, 22 Sep 2022 10:27:56 +0900
In-Reply-To: <65da0cdb245fe2bcd99589d4fb1a9eb785a1b527.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Wed, 21 Sep 2022 13:40:14 +0200")
Message-ID: <87leqcw63n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Liliana Marie Prikler <liliana.prikler@HIDDEN> writes:

> Am Mittwoch, dem 21.09.2022 um 18:59 +0900 schrieb Taiju HIGASHI:
>> Hi Liliana,
>>
>> Thank you for your review.
>>
>> > > -(define (add-fontconfig-config-file he-symlink-path)
>> > > +(define (add-fontconfig-config-file font-config)
>> > > =A0=A0 `(("fontconfig/fonts.conf"
>> > > =A0=A0=A0=A0=A0 ,(mixed-text-file
>> > > =A0=A0=A0=A0=A0=A0=A0 "fonts.conf"
>> > > =A0=A0=A0=A0=A0=A0=A0 "<?xml version=3D'1.0'?>
>> > > =A0<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
>> > > =A0<fontconfig>
>> > > -=A0 <dir>~/.guix-home/profile/share/fonts</dir>
>> > > -</fontconfig>"))))
>> > > +=A0 <dir>~/.guix-home/profile/share/fonts</dir>\n"
>> > > +=A0=A0=A0=A0=A0=A0 (if (null? font-config)
>> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ""
>> > > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (string-join font-config "\n" 'suffi=
x))
>> > > +=A0=A0=A0=A0=A0=A0 "</fontconfig>\n"))))
>> > I think it'd be wiser to pretty-print SXML here.
>> > The structure could look something like
>> > `(fontconfig
>> > =A0=A0 (dir "~/.guix-home/profile/share/fonts")
>> > =A0=A0 ,@(extra-user-config ...))
>>
>> That's definitely better!
>> Does this assume that SXML will also accept additional user settings?
> It assumes that whatever (extra-user-config ...) does, it returns a
> list of SXML nodes, e.g. ((dir "~/.fonts")).  Writing correct SXML
> should be comparatively simpler to writing correct XML.

I just sent you the v2 patch.  It uses SXML to handle the user's extra
configs.
I also made it so that the user can pass SXML directly.

I also wrote a test but did not include it in the patch because I
thought it would be a technical debt.
I'm attaching that as a reference.


--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename=fontutils.scm
Content-Transfer-Encoding: quoted-printable
Content-Description: tests/home-services/fontutils.scm

;;; GNU Guix --- Functional package management for GNU
;;; Copyright =A9 2022 Taiju HIGASHI <higashi@HIDDEN>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-home-services-fontutils)
  #:use-module (gnu services)
  #:use-module (gnu home services)
  #:use-module (gnu home services fontutils)
  #:use-module (guix tests)
  #:use-module (sxml simple)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64))

;; or (@@ (gnu home services fontutils) add-fontconfig-config-file)
(define add-fontconfig-config-file
  (let* ((extensions (service-type-extensions home-fontconfig-service-type))
         (extension (find (lambda (ext)
                            (eq? (service-extension-target ext)
                                 home-xdg-configuration-files-service-type))
                          extensions))
         (compute (service-extension-compute extension)))
    compute))

(define (assert-fontconfig-value value expected)
  (mock ((guix gexp) mixed-text-file
         (lambda* (name #:key guile #:rest text)
           (let ((text (string-join text "")))
             (unless (string=3D text expected)
               (error "assert failed. actual: %s" text)))))
        (add-fontconfig-config-file value)
        #t))

(test-begin "home-services-fontutils")

(test-assert "fontconfig (default value)"
  (assert-fontconfig-value '() "\
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig><dir>~/.guix-home/profile/share/fonts</dir></fontconfig>
"))

(test-assert "fontconfig (a text)"
  (assert-fontconfig-value '("<foo>foo</foo>") "\
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig><dir>~/.guix-home/profile/share/fonts</dir><foo>foo</foo></font=
config>
"))

(test-assert "fontconfig (multiple texts)"
  (assert-fontconfig-value '("<foo>foo</foo>" "<bar><baz>baz</baz></bar>") =
"\
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig><dir>~/.guix-home/profile/share/fonts</dir><foo>foo</foo><bar><=
baz>baz</baz></bar></fontconfig>
"))

(test-assert "fontconfig (a sxml)"
  (assert-fontconfig-value '((foo foo)) "\
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig><dir>~/.guix-home/profile/share/fonts</dir><foo>foo</foo></font=
config>
"))

(test-assert "fontconfig (multiple sxml)"
  (assert-fontconfig-value '((foo foo) (bar (baz baz))) "\
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig><dir>~/.guix-home/profile/share/fonts</dir><foo>foo</foo><bar><=
baz>baz</baz></bar></fontconfig>
"))

(test-error "fontconfig (invalid value)"
  (add-fontconfig-config-file '(123)))

(test-end "home-services-fontutils")

--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable


>> > Also, for the particular use case of handling multiple profiles
>> > gracefully (rather than the current status quo) I think fontconfig-
>> > service-type should be able to construct (dir
>> > "#$profile/share/fonts") style entries on its own.=A0 However, given
>> > that multiple profiles aren't supported yet, this is future work.
>>
>> Noted. I believe that even with the current patch, it is possible to
>> add arbitrary directories, so it will be better than what we have
>> now.
> That's fine, just know that this use case might at some point become
> obsolete thanks to a better implementation :)

No problem. I would like to solve the current problem first. A better
implementation is always welcome :)

Cheers
--=20
taiju

--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 22 Sep 2022 01:21:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 21:21:08 2022
Received: from localhost ([127.0.0.1]:35508 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1obAto-0005Eg-4Q
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 21:21:08 -0400
Received: from mail-pj1-f52.google.com ([209.85.216.52]:46064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1obAti-0005Dn-Nf
 for 57963 <at> debbugs.gnu.org; Wed, 21 Sep 2022 21:21:06 -0400
Received: by mail-pj1-f52.google.com with SMTP id
 p1-20020a17090a2d8100b0020040a3f75eso570471pjd.4
 for <57963 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 18:21:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date;
 bh=rIL9alDk/h4IHhW6O2PK1plbXPTTrfvcaPUJzEtmTxE=;
 b=sPqkBmdQooAoaz44YMlb0kShyyS2EwkZzcqoxu7ERsW4wcTJOl41SA65WUc6mwcdKz
 Wdz7olrgs0Yn8P0bgWPTkExH5K4T/oztR7C5i2y/J2pTCXY7DF98Z/YQ2cNoVu5cKJq4
 R2WVZkcQWPBeGdfigjgU9Ym3ypz5WJgBpeU/2FMv3Kh5w5RZiqogXL4H4qqjZCnc+IAB
 vcTIwmcyihNnjrGmJ/KH5tk0rb5HWpbMUF8Vf+UDgStuuDpOHWh8sga/zOcalHKujZx2
 iquntOs/qtBAlG6rZpkBXWNDkwIf8ZVlbpAfCHbeC7vVhfdVdODw3j1tlnGG/AAnzj1H
 Wwtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=rIL9alDk/h4IHhW6O2PK1plbXPTTrfvcaPUJzEtmTxE=;
 b=D3/3MjmdfWL/5g98WVg5qZTjuy9BbrBs9mWVBWBCw4NgFFWXD/yaglsmogei2GDme9
 KJf8Z5345Qai6K5eESyOmUXz9bWc9dULgsb1TyJXFQQuepM4JjthsY41zemdwtmI+jvY
 Ttk4lqlzT0vPSaUrUIH9U9E7XK1tzKesqQmx0fsMo+MAuHc9JM3z95F6sun4vuawJruA
 088jdexnoUEPe3Gd2EXfFb8VaO/5gW3MWwqMUq/3gckUUIhqZJgT1Pqz/zd/yoUoBPpB
 hOwVf5hW/JepQntKJk4m9tS2KsyAOfivcNRW3RWI5K6eZzalZbHuHDQfXQYqtjJzy8dB
 V6XQ==
X-Gm-Message-State: ACrzQf0MUy7pdyhFQDtyMs1/JVVzGIJQEchWjj76Dj/50twz0kApCZES
 R4Xmw4fGGMUljAi5JaxbDxxTx0t+L9ktWBgf
X-Google-Smtp-Source: AMsMyM5m1XlloRtra3Ivs3sUkakaUq4wqcUhUSHHWDdjOB81uKARIDau5tAPjaI3G9TkH09gD+j2Jg==
X-Received: by 2002:a17:902:b415:b0:178:2835:29e7 with SMTP id
 x21-20020a170902b41500b00178283529e7mr936781plr.86.1663809656469; 
 Wed, 21 Sep 2022 18:20:56 -0700 (PDT)
Received: from Taix.flets-west.jp ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 d18-20020a170902ced200b001783f964fe3sm2660325plg.113.2022.09.21.18.20.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Sep 2022 18:20:55 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: 57963 <at> debbugs.gnu.org
Subject: [PATCH v2] home: fontutils: Support user's fontconfig.
Date: Thu, 22 Sep 2022 10:20:33 +0900
Message-Id: <20220922012033.30835-1-higashi@HIDDEN>
X-Mailer: git-send-email 2.37.3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: * gnu/home/services/fontutils.scm
 (add-fontconfig-config-file):
 Support user's fontconfig. --- gnu/home/services/fontutils.scm | 29
 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 de [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_NONE               SPF: sender does not publish an SPF Record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [209.85.216.52 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.216.52 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 57963
Cc: Taiju HIGASHI <higashi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

* gnu/home/services/fontutils.scm (add-fontconfig-config-file): Support user's
fontconfig.
---
 gnu/home/services/fontutils.scm | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm
index 6062eaed6a..b57cccbaae 100644
--- a/gnu/home/services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
+;;; Copyright © 2022 Taiju HIGASHI <higashi@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,9 @@ (define-module (gnu home services fontutils)
   #:use-module (gnu home services)
   #:use-module (gnu packages fontutils)
   #:use-module (guix gexp)
+  #:use-module (srfi srfi-1)
+  #:use-module (sxml simple)
+  #:use-module (ice-9 match)
 
   #:export (home-fontconfig-service-type))
 
@@ -33,15 +37,28 @@ (define-module (gnu home services fontutils)
 ;;;
 ;;; Code:
 
-(define (add-fontconfig-config-file he-symlink-path)
+(define (parse-extra-user-config extra-user-config)
+  (map (match-lambda
+         ((? pair? sxml) sxml)
+         ((? string? xml) (xml->sxml xml))
+         (_ (error "extra-user-config must be xml string or sxml.")))
+       extra-user-config))
+
+(define (add-fontconfig-config-file extra-user-config)
   `(("fontconfig/fonts.conf"
      ,(mixed-text-file
        "fonts.conf"
        "<?xml version='1.0'?>
 <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
-<fontconfig>
-  <dir>~/.guix-home/profile/share/fonts</dir>
-</fontconfig>"))))
+"
+       (call-with-output-string
+         (lambda (port)
+           (sxml->xml
+            `(fontconfig
+              (dir "~/.guix-home/profile/share/fonts")
+              ,@(parse-extra-user-config extra-user-config))
+            port)
+           (newline port)))))))
 
 (define (regenerate-font-cache-gexp _)
   `(("profile/share/fonts"
@@ -49,6 +66,8 @@ (define (regenerate-font-cache-gexp _)
 
 (define home-fontconfig-service-type
   (service-type (name 'home-fontconfig)
+                (compose concatenate)
+                (extend append)
                 (extensions
                  (list (service-extension
                         home-xdg-configuration-files-service-type
@@ -59,7 +78,7 @@ (define home-fontconfig-service-type
                        (service-extension
                         home-profile-service-type
                         (const (list fontconfig)))))
-                (default-value #f)
+                (default-value '())
                 (description
                  "Provides configuration file for fontconfig and make
 fc-* utilities aware of font packages installed in Guix Home's profile.")))
-- 
2.37.3





Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 21 Sep 2022 11:40:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 07:40:22 2022
Received: from localhost ([127.0.0.1]:60925 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oay5W-0000Oh-AP
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:40:22 -0400
Received: from mailrelay.tugraz.at ([129.27.2.202]:37950)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1oay5U-0000OT-Dd
 for 57963 <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:40:21 -0400
Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101])
 by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4MXc0b59g9z1DPy8;
 Wed, 21 Sep 2022 13:40:15 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4MXc0b59g9z1DPy8
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at;
 s=mailrelay; t=1663760416;
 bh=7c64LMVhIQbeeocNQtA2/JjHpJK3h9uF/0nODBf+fI0=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References:From;
 b=fr86r7sbC1j8Pj2IbPtva/RFnxu6jn40GNKWRrQI5DIhIxajXfKTUifR8+2m4SKdx
 X3W11fR9tr943ZG4OVLAaTM03zDZy+H2eMumAqvMjExVEL/bcWRNNA0aCRAkfTRGuX
 NyDBjNaWUqOnOCzkCLNYWIXJnmxwxLy0SerFlzss=
Message-ID: <65da0cdb245fe2bcd99589d4fb1a9eb785a1b527.camel@HIDDEN>
Subject: Re: [PATCH 1/1] home: fontutils: Support user's fontconfig.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Taiju HIGASHI <higashi@HIDDEN>
Date: Wed, 21 Sep 2022 13:40:14 +0200
In-Reply-To: <871qs5xd30.fsf@HIDDEN>
References: <20220921002921.23631-2-higashi@HIDDEN>
 <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
 <871qs5xd30.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.45.3 
MIME-Version: 1.0
X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ
X-Spam-Scanner: SpamAssassin 3.003001 
X-Spam-Score-relay: -1.9
X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Am Mittwoch, dem 21.09.2022 um 18:59 +0900 schrieb Taiju HIGASHI:
> Hi Liliana,
>=20
> Thank you for your review.
>=20
> > > -(define (add-fontconfig-config-file he-symlink-path)
> > > +(define (add-fontconfig-config-file font-config)
> > > =C2=A0=C2=A0 `(("fontconfig/fonts.conf"
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(mixed-text-file
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "fonts.conf"
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "<?xml version=3D'1.0'?>
> > > =C2=A0<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> > > =C2=A0<fontconfig>
> > > -=C2=A0 <dir>~/.guix-home/profile/share/fonts</dir>
> > > -</fontconfig>"))))
> > > +=C2=A0 <dir>~/.guix-home/profile/share/fonts</dir>\n"
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (null? font-config)
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ""
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string=
-join font-config "\n" 'suffix))
> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "</fontconfig>\n"))))
> > I think it'd be wiser to pretty-print SXML here.
> > The structure could look something like
> > `(fontconfig
> > =C2=A0=C2=A0 (dir "~/.guix-home/profile/share/fonts")
> > =C2=A0=C2=A0 ,@(extra-user-config ...))
>=20
> That's definitely better!
> Does this assume that SXML will also accept additional user settings?
It assumes that whatever (extra-user-config ...) does, it returns a
list of SXML nodes, e.g. ((dir "~/.fonts")).  Writing correct SXML
should be comparatively simpler to writing correct XML.

> > Also, for the particular use case of handling multiple profiles
> > gracefully (rather than the current status quo) I think fontconfig-
> > service-type should be able to construct (dir
> > "#$profile/share/fonts") style entries on its own.=C2=A0 However, given
> > that multiple profiles aren't supported yet, this is future work.
>=20
> Noted. I believe that even with the current patch, it is possible to
> add arbitrary directories, so it will be better than what we have
> now.
That's fine, just know that this use case might at some point become
obsolete thanks to a better implementation :)




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 21 Sep 2022 09:59:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 05:59:43 2022
Received: from localhost ([127.0.0.1]:60737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oawW7-0007t3-Ik
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 05:59:43 -0400
Received: from mail-pg1-f178.google.com ([209.85.215.178]:38467)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1oawW4-0007sp-Bf
 for 57963 <at> debbugs.gnu.org; Wed, 21 Sep 2022 05:59:42 -0400
Received: by mail-pg1-f178.google.com with SMTP id t70so5415272pgc.5
 for <57963 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 02:59:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject
 :date; bh=dcUdtul+/c5tYibo0P+kA/1g7XOiyIvJp0/xKXYa4DI=;
 b=OXpaNzw+2J/hjCTer+/sBYzWZzDTqKHxAWbjCL62MrM5KoarrZxakr5rMvzToVZEkv
 UYTAaifr5/sa+EV8119GPPERL32PpjBfkbv9OEcHtKB6RlqU2iv2xqIpcGmKCezo8TNG
 Eh2VXrq4oSCv13GzxdiRN4ZL7GhxPrBDug4VxR9jlao8WrvDk7URWf3zv8tZ2/Esi/Ra
 peNBSvPwokKH66znodlgRX/XeBxX2JmxDVbZwPGeR8LsJ7GLdXLAj4ONbU2QFWjZjg1M
 44+xeIFgBcjDBqKECsqrag+zbMJeyR2/qGBjBldS3L2gaVAEL/pWNlXR1W54EakOywg/
 c/yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id
 :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state
 :from:to:cc:subject:date;
 bh=dcUdtul+/c5tYibo0P+kA/1g7XOiyIvJp0/xKXYa4DI=;
 b=oCncJ7DVxmrgFstsWD2YIEryFp7cr9UIvVpTWMImvnN7NajDICPo2Nmg4AuSAelDrD
 nIVAkwzdKp+UZxHIOl6ZAzqqVSy5jdfiepvml5wqUDFa7/gdDvqrV1W6cwieq3a4AJqr
 OCzWOnk/YzeQzGEyNwAiKcgUtZZilkIHNo9/dB+afq4iZ5WjyqYmS5RMeunYJN6GR50Z
 IhPRQWjLuCWMDUhH1fav2Bz//vWUB3AQGFzUiF9ky+mFrWRt2f2B1jUG7Yl7WUcvQ4VB
 N05HP0gsr+fodURdi0rp+x8MzbrW1H3PahzOMD+nDZmArdpn+qu2HTasNjx2daEOPcbR
 FX3A==
X-Gm-Message-State: ACrzQf1HmtFHRuPRlOi4sYDwmadbb6jtInG0G5n1g9tDFqCBvHTb2XhE
 32fEgHYcl1okSf/aA7hii7+/Nbr94Vg+dbUj
X-Google-Smtp-Source: AMsMyM765QIAJ23b3dhFUHfWPT53F2GmXj9s3IIVFuwfq2ZpVgcGKOXs7aFBiSbSG0r6GP/FX0ic3Q==
X-Received: by 2002:aa7:9851:0:b0:53e:87eb:1ffa with SMTP id
 n17-20020aa79851000000b0053e87eb1ffamr28222435pfq.35.1663754374138; 
 Wed, 21 Sep 2022 02:59:34 -0700 (PDT)
Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 c6-20020a170903234600b0017680faa1a8sm1562347plh.112.2022.09.21.02.59.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Sep 2022 02:59:33 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: [PATCH 1/1] home: fontutils: Support user's fontconfig.
References: <20220921002921.23631-2-higashi@HIDDEN>
 <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
Date: Wed, 21 Sep 2022 18:59:31 +0900
In-Reply-To: <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Wed, 21 Sep 2022 10:54:34 +0200")
Message-ID: <871qs5xd30.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57963
Cc: 57963 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Liliana,

Thank you for your review.

>> -(define (add-fontconfig-config-file he-symlink-path)
>> +(define (add-fontconfig-config-file font-config)
>> =A0=A0 `(("fontconfig/fonts.conf"
>> =A0=A0=A0=A0=A0 ,(mixed-text-file
>> =A0=A0=A0=A0=A0=A0=A0 "fonts.conf"
>> =A0=A0=A0=A0=A0=A0=A0 "<?xml version=3D'1.0'?>
>> =A0<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
>> =A0<fontconfig>
>> -=A0 <dir>~/.guix-home/profile/share/fonts</dir>
>> -</fontconfig>"))))
>> +=A0 <dir>~/.guix-home/profile/share/fonts</dir>\n"
>> +=A0=A0=A0=A0=A0=A0 (if (null? font-config)
>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ""
>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (string-join font-config "\n" 'suffix))
>> +=A0=A0=A0=A0=A0=A0 "</fontconfig>\n"))))
> I think it'd be wiser to pretty-print SXML here.
> The structure could look something like
> `(fontconfig
>    (dir "~/.guix-home/profile/share/fonts")
>    ,@(extra-user-config ...))

That's definitely better!
Does this assume that SXML will also accept additional user settings?

> Also, for the particular use case of handling multiple profiles
> gracefully (rather than the current status quo) I think fontconfig-
> service-type should be able to construct (dir "#$profile/share/fonts")
> style entries on its own.  However, given that multiple profiles aren't
> supported yet, this is future work.

Noted. I believe that even with the current patch, it is possible to add
arbitrary directories, so it will be better than what we have now.

Cheers
--=20
taiju




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 21 Sep 2022 08:54:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 04:54:44 2022
Received: from localhost ([127.0.0.1]:60610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oavVE-00066m-5H
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 04:54:44 -0400
Received: from mailrelay.tugraz.at ([129.27.2.202]:19475)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1oavV9-00066U-3l
 for 57963 <at> debbugs.gnu.org; Wed, 21 Sep 2022 04:54:42 -0400
Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101])
 by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4MXXKR14W2z1LZWr;
 Wed, 21 Sep 2022 10:54:35 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4MXXKR14W2z1LZWr
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at;
 s=mailrelay; t=1663750475;
 bh=SiewZ3YU/RLxivLopaQMakfaHyE1Xt3JfmoPGcAK4IE=;
 h=Subject:From:To:Date:In-Reply-To:References:From;
 b=uSRE6G2kj61PuU1pga63SjQONpOWdIdxHqXUrcx6MRPYGblIcoLIs5TLJEwGwO06f
 IF28mSqhd2QsS+hDQBPEzi6aLVlM38y2hL0pwnMuv8wSl2ro9RVhkXnO+L2uj8FhZ2
 cSKryeoe+tH28Q/LjP9/sTFsdvfa/2UyLSE7xP4Q=
Message-ID: <eb87ef1cd1311448fc57ed045deb8de1311c6322.camel@HIDDEN>
Subject: Re: [PATCH 1/1] home: fontutils: Support user's fontconfig.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Taiju HIGASHI <higashi@HIDDEN>, 57963 <at> debbugs.gnu.org
Date: Wed, 21 Sep 2022 10:54:34 +0200
In-Reply-To: <20220921002921.23631-2-higashi@HIDDEN>
References: <20220921002921.23631-2-higashi@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.45.3 
MIME-Version: 1.0
X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ
X-Spam-Scanner: SpamAssassin 3.003001 
X-Spam-Score-relay: -0.4
X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117
X-Spam-Score: -0.3 (/)
X-Debbugs-Envelope-To: 57963
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

Am Mittwoch, dem 21.09.2022 um 09:29 +0900 schrieb Taiju HIGASHI:
> * gnu/home/services/fontutils.scm (add-fontconfig-config-file):
> Support user's fontconfig.
> ---
> =C2=A0gnu/home/services/fontutils.scm | 15 +++++++++++----
> =C2=A01 file changed, 11 insertions(+), 4 deletions(-)
>=20
> diff --git a/gnu/home/services/fontutils.scm
> b/gnu/home/services/fontutils.scm
> index 6062eaed6a..3ea8b1db74 100644
> --- a/gnu/home/services/fontutils.scm
> +++ b/gnu/home/services/fontutils.scm
> @@ -1,6 +1,7 @@
> =C2=A0;;; GNU Guix --- Functional package management for GNU
> =C2=A0;;; Copyright =C2=A9 2021 Andrew Tropin <andrew@HIDDEN>
> =C2=A0;;; Copyright =C2=A9 2021 Xinglu Chen <public@HIDDEN>
> +;;; Copyright =C2=A9 2022 Taiju HIGASHI <higashi@HIDDEN>
> =C2=A0;;;
> =C2=A0;;; This file is part of GNU Guix.
> =C2=A0;;;
> @@ -21,6 +22,7 @@ (define-module (gnu home services fontutils)
> =C2=A0=C2=A0 #:use-module (gnu home services)
> =C2=A0=C2=A0 #:use-module (gnu packages fontutils)
> =C2=A0=C2=A0 #:use-module (guix gexp)
> +=C2=A0 #:use-module (srfi srfi-1)
> =C2=A0
> =C2=A0=C2=A0 #:export (home-fontconfig-service-type))
> =C2=A0
> @@ -33,15 +35,18 @@ (define-module (gnu home services fontutils)
> =C2=A0;;;
> =C2=A0;;; Code:
> =C2=A0
> -(define (add-fontconfig-config-file he-symlink-path)
> +(define (add-fontconfig-config-file font-config)
> =C2=A0=C2=A0 `(("fontconfig/fonts.conf"
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(mixed-text-file
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "fonts.conf"
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "<?xml version=3D'1.0'?>
> =C2=A0<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> =C2=A0<fontconfig>
> -=C2=A0 <dir>~/.guix-home/profile/share/fonts</dir>
> -</fontconfig>"))))
> +=C2=A0 <dir>~/.guix-home/profile/share/fonts</dir>\n"
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (null? font-config)
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ""
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-joi=
n font-config "\n" 'suffix))
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "</fontconfig>\n"))))
I think it'd be wiser to pretty-print SXML here.
The structure could look something like
`(fontconfig=C2=A0
   (dir "~/.guix-home/profile/share/fonts")
   ,@(extra-user-config ...))

Also, for the particular use case of handling multiple profiles
gracefully (rather than the current status quo) I think fontconfig-
service-type should be able to construct (dir "#$profile/share/fonts")
style entries on its own.  However, given that multiple profiles aren't
supported yet, this is future work.

Cheers




Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at 57963 <at> debbugs.gnu.org:


Received: (at 57963) by debbugs.gnu.org; 21 Sep 2022 00:29:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 20:29:45 2022
Received: from localhost ([127.0.0.1]:60072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oancW-0007b7-Lv
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 20:29:44 -0400
Received: from mail-pg1-f175.google.com ([209.85.215.175]:44886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1oancU-0007aq-Cy
 for 57963 <at> debbugs.gnu.org; Tue, 20 Sep 2022 20:29:42 -0400
Received: by mail-pg1-f175.google.com with SMTP id c7so4316546pgt.11
 for <57963 <at> debbugs.gnu.org>; Tue, 20 Sep 2022 17:29:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date;
 bh=wz0FAF8lUUJIDLZjh0sc33ihU8m/ext0PdmPTJHBuwE=;
 b=3M0dmK6dPkFWVKQlS47Ge0JcsugiXonm14ZqayPq4zyF5MFlu9pYJwBr58BrRGzg6N
 GK8+br4KDKCzoUCE76bYxKqmX7S/KeOeUy81oiC2/ph878lMOYrcRvkZ9/jRU8/+u5Kp
 urE1cAph/8+ersCkOocYWMT9c37wB2mDcosYlfDFPr/7h/RHkNUPAULGCzBtjyZ7gRWP
 sV1saTu7lBnV4YhIt4v1t7KcaMR9CEliApzSripf/AH4C3i1wzSv/ovwyXSpDyB1KywB
 kknnWXEvgESZZu+yK6Cjo9qwDpBiBSy4+S25d4C2xbq23110IL1TZhXP5PMKq4Moy/Mf
 8vQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=wz0FAF8lUUJIDLZjh0sc33ihU8m/ext0PdmPTJHBuwE=;
 b=Yq0v3oQCLFTN5N8uDAW47J34Tx734RHW28xmfHbOkn+tp88Sv+aDNzh7J/MMJcIkDY
 jY4PWJ5vzoJBBVlMW/4LBqoWGOAnCOgDH3VP8BTGWzF2yCJVwNsYymgJODztF6WoiHcL
 J4dysU0YdAgvRxTWuqk5f97UqUtvZ3Bz2UWylZv8vp0AUz0i4LdfgLmKgnk7XUk3t6+V
 +VFgvKTilBbIvpxC6is+VntW2/g0h3apLKP8/SAx75pL+7eH4wC9I5aHOIJiETQ6S/AO
 W3lSVTYD2pkpKenE02tVMlyfdrhtPPPywrUZChfl+ebP6uEe3DuTapPXr2xqE6+q25ct
 b/LQ==
X-Gm-Message-State: ACrzQf09ZpVFl1qGH2YX4tMMnxr244zqJZF2aNTjB4b7nfAnp15BZqR9
 647RlBGrhfZnipkTwTdwytX1g+5rpLKw5MiY
X-Google-Smtp-Source: AMsMyM7E1fUz8fovv13QxvPsavuL2aNLYzxNVifSvz2YitLTm9A+LI4ID5jvw2hvW1QVeRX8/LQxxw==
X-Received: by 2002:a63:2bcc:0:b0:439:36bb:c036 with SMTP id
 r195-20020a632bcc000000b0043936bbc036mr22304743pgr.447.1663720176217; 
 Tue, 20 Sep 2022 17:29:36 -0700 (PDT)
Received: from Taix.flets-west.jp ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 u1-20020a626001000000b0053b9e5d365bsm494914pfb.216.2022.09.20.17.29.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Sep 2022 17:29:35 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: 57963 <at> debbugs.gnu.org
Subject: [PATCH 1/1] home: fontutils: Support user's fontconfig.
Date: Wed, 21 Sep 2022 09:29:21 +0900
Message-Id: <20220921002921.23631-2-higashi@HIDDEN>
X-Mailer: git-send-email 2.37.3
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: * gnu/home/services/fontutils.scm
 (add-fontconfig-config-file):
 Support user's fontconfig. --- gnu/home/services/fontutils.scm | 15
 +++++++++++---- 1 file changed, 11 insertions(+),
 4 deletions(-) diff --git a/gnu/home/services/fontutils.scm
 b/gnu/home/services/fontutils.scm index 6062eaed6a..3ea8b1db74 100644 ---
 a/gnu/home/services/fontutils.scm +++ b/gnu/home/services/fontutils.scm @@
 -1,6 + [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_NONE               SPF: sender does not publish an SPF Record
 2.0 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.215.175 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.215.175 listed in wl.mailspike.net]
X-Debbugs-Envelope-To: 57963
Cc: Taiju HIGASHI <higashi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

* gnu/home/services/fontutils.scm (add-fontconfig-config-file): Support user's
fontconfig.
---
 gnu/home/services/fontutils.scm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gnu/home/services/fontutils.scm b/gnu/home/services/fontutils.scm
index 6062eaed6a..3ea8b1db74 100644
--- a/gnu/home/services/fontutils.scm
+++ b/gnu/home/services/fontutils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
+;;; Copyright © 2022 Taiju HIGASHI <higashi@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +22,7 @@ (define-module (gnu home services fontutils)
   #:use-module (gnu home services)
   #:use-module (gnu packages fontutils)
   #:use-module (guix gexp)
+  #:use-module (srfi srfi-1)
 
   #:export (home-fontconfig-service-type))
 
@@ -33,15 +35,18 @@ (define-module (gnu home services fontutils)
 ;;;
 ;;; Code:
 
-(define (add-fontconfig-config-file he-symlink-path)
+(define (add-fontconfig-config-file font-config)
   `(("fontconfig/fonts.conf"
      ,(mixed-text-file
        "fonts.conf"
        "<?xml version='1.0'?>
 <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
 <fontconfig>
-  <dir>~/.guix-home/profile/share/fonts</dir>
-</fontconfig>"))))
+  <dir>~/.guix-home/profile/share/fonts</dir>\n"
+       (if (null? font-config)
+           ""
+           (string-join font-config "\n" 'suffix))
+       "</fontconfig>\n"))))
 
 (define (regenerate-font-cache-gexp _)
   `(("profile/share/fonts"
@@ -49,6 +54,8 @@ (define (regenerate-font-cache-gexp _)
 
 (define home-fontconfig-service-type
   (service-type (name 'home-fontconfig)
+                (compose concatenate)
+                (extend append)
                 (extensions
                  (list (service-extension
                         home-xdg-configuration-files-service-type
@@ -59,7 +66,7 @@ (define home-fontconfig-service-type
                        (service-extension
                         home-profile-service-type
                         (const (list fontconfig)))))
-                (default-value #f)
+                (default-value '())
                 (description
                  "Provides configuration file for fontconfig and make
 fc-* utilities aware of font packages installed in Guix Home's profile.")))
-- 
2.37.3





Information forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Sep 2022 00:27:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 20:27:43 2022
Received: from localhost ([127.0.0.1]:60067 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oanaZ-0007Xf-69
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 20:27:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:32832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@HIDDEN>) id 1oanaX-0007XY-UJ
 for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 20:27:42 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38094)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <higashi@HIDDEN>)
 id 1oanaW-0006j5-HG
 for guix-patches@HIDDEN; Tue, 20 Sep 2022 20:27:40 -0400
Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:42756)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <higashi@HIDDEN>)
 id 1oanaT-0002Ax-VM
 for guix-patches@HIDDEN; Tue, 20 Sep 2022 20:27:39 -0400
Received: by mail-pl1-x635.google.com with SMTP id v1so4031462plo.9
 for <guix-patches@HIDDEN>; Tue, 20 Sep 2022 17:27:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=taiju-info.20210112.gappssmtp.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date;
 bh=i9X28lRC10/wDMzT13xQWNgyw28Ty7Te0iOfB1EO7Yw=;
 b=Mwi15I0O2tLj8Y+pwAF/x6IvAlHaOtCWQX3JdCpTtLWAUEyz76LWvkoGbzWKrlIOSm
 7oMszS20nArrVayzn1pCvDeZvLAb04VJWrTtduJ1FsdUJq1Q+Geg8vEEkafbrBSSz2kp
 HbQR+X8GiAR59HjWNCjd1IK90oStNAjc+sKeaFTEkt1biBLNntLI+GORWpepHXRGQMB9
 VyREJQ45hnOeB/HXbryY69zjZhU/SoP597Nal4Bl1TThjuWib/D0GqJqFQvXuyTPfgmK
 MycvjGJG7ZSj+AZ0e4GrGtO3mpitbIwHW8wUxT/f9RjesYJV2NZZMmxeSN0HHlzPkNPG
 ErrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date;
 bh=i9X28lRC10/wDMzT13xQWNgyw28Ty7Te0iOfB1EO7Yw=;
 b=vpHqALaBx2YvA6Cz/3fGq6FoqkOFuO5r5gSONr+xTSG9WrNEs+uQtNgac0sD7MzvEZ
 Yurkhh/ontYLUzrJL7PazeO6J25dpjJgtaMFkQLscDZpfIyhsHu5mi4DHFf8uoMGRJhK
 cKCRoTJazZSPMZ2umS3+vF8+PX2OmNQFZhjfU2HeJaN2MqUme2kj/Sx+xOo6BUhF1nTH
 b16MXO7ocVp2Nb0z8s7poTMT6KRwEEeUzfDy5RN/m5bRloOP7OrEuPqOc8tsnp42F0dU
 NXdCfWJm5WpmGpS5+fCnxFZNYbVK+TcekBavxiya2wwUfxbvBQhh88KwxKNos+9OEAE9
 7Fhg==
X-Gm-Message-State: ACrzQf2a9llIc7OwAeYaDdWbZwe13vFJ0iGpGB4hzOWV34BStjPhO/to
 IdLy+T5STXgJBt18vHH4dwHW1qrbdrHUXgKx
X-Google-Smtp-Source: AMsMyM6k+9vhgRSJLwS/ulRJTmoNa0eodIXbEGDUHxvAlFQSMsHkrHWZ1LubDEeZCZkoPEUFTVMSkg==
X-Received: by 2002:a17:902:b281:b0:177:f1db:9a32 with SMTP id
 u1-20020a170902b28100b00177f1db9a32mr2089848plr.149.1663720052947; 
 Tue, 20 Sep 2022 17:27:32 -0700 (PDT)
Received: from Taix.flets-west.jp ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 p1-20020a170902bd0100b001769e6d4fafsm530808pls.57.2022.09.20.17.27.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Sep 2022 17:27:32 -0700 (PDT)
From: Taiju HIGASHI <higashi@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/1] Support user's fontconfig.
Date: Wed, 21 Sep 2022 09:27:20 +0900
Message-Id: <20220921002721.23511-1-higashi@HIDDEN>
X-Mailer: git-send-email 2.37.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: none client-ip=2607:f8b0:4864:20::635;
 envelope-from=higashi@HIDDEN; helo=mail-pl1-x635.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Taiju HIGASHI <higashi@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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




Acknowledgement sent to Taiju HIGASHI <higashi@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#57963; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 24 Sep 2022 16:00:02 UTC

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