From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp10.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id wCd5F/YDMWN15QAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 26 Sep 2022 03:44:22 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp10.migadu.com with LMTPS
	id oOmlFvYDMWM0iwAAG6o9tA
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Mon, 26 Sep 2022 03:44:22 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id E43B8F958
	for <larch@yhetil.org>; Mon, 26 Sep 2022 03:44:21 +0200 (CEST)
Received: from localhost ([::1]:38130 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	id 1ocdAS-0000Rf-Sm
	for larch@yhetil.org; Sun, 25 Sep 2022 21:44:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:55066)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1ocdAB-0000RX-3y
 for guix-patches@gnu.org; Sun, 25 Sep 2022 21:44:03 -0400
Received: from debbugs.gnu.org ([209.51.188.43]:49713)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1ocdAA-00086f-O9
 for guix-patches@gnu.org; Sun, 25 Sep 2022 21:44:02 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1ocdAA-0005d5-Hf
 for guix-patches@gnu.org; Sun, 25 Sep 2022 21:44:02 -0400
X-Loop: help-debbugs@gnu.org
Subject: [bug#57963] [PATCH 0/1] Support user's fontconfig.
Resent-From: Taiju HIGASHI <higashi@taiju.info>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Mon, 26 Sep 2022 01:44:02 +0000
Resent-Message-ID: <handler.57963.B57963.166415663521620@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 57963
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>, 57963@debbugs.gnu.org,
 Andrew Tropin <andrew@trop.in>
Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.166415663521620
 (code B ref 57963); Mon, 26 Sep 2022 01:44:02 +0000
Received: (at 57963) by debbugs.gnu.org; 26 Sep 2022 01:43:55 +0000
Received: from localhost ([127.0.0.1]:48791 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1ocdA2-0005cc-Mc
 for submit@debbugs.gnu.org; Sun, 25 Sep 2022 21:43:55 -0400
Received: from mail-pf1-f177.google.com ([209.85.210.177]:37455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <higashi@taiju.info>) id 1ocdA0-0005cP-5S
 for 57963@debbugs.gnu.org; Sun, 25 Sep 2022 21:43:53 -0400
Received: by mail-pf1-f177.google.com with SMTP id a80so5252751pfa.4
 for <57963@debbugs.gnu.org>; Sun, 25 Sep 2022 18:43:52 -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=IyEzSsNznz9Ua3L/xvQHGN5/5vBlQd8uBcCLO3DMLJY=;
 b=5gPVD0yNLzxZXCi/ApQ7pGvsfZz/g8j0oFpyKFKl0SXApuRM2MfT1fE+00+iRf5n5x
 LqgcfUzc87HunhBA4e522qX3aSTPhGEB4vGROnmxz8DQXlz3dTl1nYfy32AbiCWqj0nJ
 UYPoupcEsBbTOR37a1SVkYdxG/SiBrAW4KJzDK0cvGE0Raa+QP7SapGSOsAQ0buHIaja
 LtR0es+riIcyp6tKpNrPGp8Wfv4pLAhvbzcB6xxJ19W8D/zHkYdp2LT8Ajv/92jylT8x
 aACpY6YSn9beNp+cBNWLvcwQT/1L5vjBA1mQL5Oh7A0HI2FqdhW81+3/Vb55KQwoaC1E
 6oUw==
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=IyEzSsNznz9Ua3L/xvQHGN5/5vBlQd8uBcCLO3DMLJY=;
 b=alnG/MBYVXSE7Vk/Hosvauj0AsQU9xNlpnaCRJrPI0pLizyo0s4z8UFVDgPQrr1xk6
 l4teCNjIpcK8I/buFyTYtW1ayy8OvnopxmACCbiJdm2mnx74H6ocy2m/RbRVX6fRSHGw
 +ECzsj2MnwYkbzG6z8e1XldquluvFTdjIOxa6auBpnQ+awesh3MUeUjLLfwBxptV6f3R
 DYJsSq/BXSmnte9qmJmBgbFufhUoWWu1v3JViSYbyvQrAEuh7nyEPrKojT23v5nvS6N2
 wUl21Uf8Y41tNfBp5XtzKB4bMobODEKRhu0Ct/T1pd8JFQx8ca3S97DGsa6rH59tkpvl
 AJpQ==
X-Gm-Message-State: ACrzQf3AW42ZCSmQS2P6a4UI7/D6t5tra8QHqP8Gux2YSRKBQdSueqM7
 yZdwhji0uS5ac/Xhp7/QY5lEm9W6uK0DQCKq
X-Google-Smtp-Source: AMsMyM5N3CWOhj0Jgj8TIc0B5LQ4vzZTmxtNZGLmLgh6X0HdK2itwi+pX/5+1XsjqCWggjjl/t4XEw==
X-Received: by 2002:a63:5266:0:b0:439:920b:fc65 with SMTP id
 s38-20020a635266000000b00439920bfc65mr17681260pgl.417.1664156626005; 
 Sun, 25 Sep 2022 18:43:46 -0700 (PDT)
Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925])
 by smtp.gmail.com with ESMTPSA id
 z25-20020aa79599000000b005361f6a0573sm10606718pfj.44.2022.09.25.18.43.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 25 Sep 2022 18:43:44 -0700 (PDT)
From: Taiju HIGASHI <higashi@taiju.info>
References: <20220921002721.23511-1-higashi@taiju.info>
 <20220922012033.30835-1-higashi@taiju.info> <87pmfoq6kt.fsf@trop.in>
 <87sfkjiyck.fsf@gnu.org> <875yhfwxe9.fsf@taiju.info>
 <871qs093dq.fsf_-_@gnu.org> <87edw0v0qk.fsf@taiju.info>
 <0fdb0df07f50700454bf34cbb0d86c46bb9afe79.camel@gmail.com>
 <87leq7ud1s.fsf@taiju.info>
 <bfa2b7d3fccafadfe6c436c850cb29ddaf46f313.camel@gmail.com>
Date: Mon, 26 Sep 2022 10:43:40 +0900
In-Reply-To: <bfa2b7d3fccafadfe6c436c850cb29ddaf46f313.camel@gmail.com>
 (Liliana Marie Prikler's message of "Sun, 25 Sep 2022 17:50:00 +0200")
Message-ID: <87zgemrjub.fsf@taiju.info>
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-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: "Guix-patches" <guix-patches-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-To: larch@yhetil.org
X-Migadu-Country: US
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1664156662;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=IyEzSsNznz9Ua3L/xvQHGN5/5vBlQd8uBcCLO3DMLJY=;
	b=OKN8ifyIfcMWzMvLFxlA6BjA4vDlcLu+8Y5iMneXnQKxI9xOPf5o8zZyRpzM8UUNyiaYzQ
	rfgil7KnK8jHfifMDfymnqvAy55p890UedmpKwPgpFOW717VBDcI3Yjjb4HKk1AQk2Wfeo
	r11d4OlbK8EhJyt4coF5IOu3uvSz91ehGc+H1yk20XWoF6RdFfr/1MoYcw284PtF64WZFM
	sFQYveK/JCUvNZRWLv75ZGDuS0ZKyg2XeCUlkrrDstwK4XaJ0YiD5T+1o7Fry9VbL8nzZJ
	p4xiUfVZ/j4xoAVSlGDFZxUo3gWG/HbCyNaxDhUxQTfYz+HFcLz34TLrnqY9ZQ==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664156662; a=rsa-sha256; cv=none;
	b=h6IeaZWEwzxq2fcEesCIhXrWQHTeG8ewCfnCOLKHRrka7hDb8okCKcUX2BjYMf+Kh+rYeS
	+8x5Qo44zn5WzLleeg8fCIK00LsbyKOyhLdjrLPiBBMWah1fb88M6zVei6JZlaX3A3177b
	xhAUTrBpfgTFF+0iBE7vEnMFVbORqR8xGv7wqpRTzuEei9OUDlj3tOSJ1KKsAq2Yu+74Mw
	IxYjKhMpf30J5lGdXK9wWodObntAMWs3Z08/0ledkIA54hkwLOfXJfOZdgL5Sjvt006pK2
	EhE+1EAf2WL3RYCdPd/q5B6BD9BFeVc5RIPkWZ3iYDyGJUWvO6HQ2o3PcA0wVw==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=5gPVD0yN;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Spam-Score: 3.86
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=5gPVD0yN;
	dmarc=none;
	spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"
X-Migadu-Queue-Id: E43B8F958
X-Spam-Score: 3.86
X-Migadu-Scanner: scn0.migadu.com
X-TUID: O+DlLQPEWk+s

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Sonntag, dem 25.09.2022 um 16:29 +0900 schrieb Taiju HIGASHI:
>> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
>>
>> > Am Sonntag, dem 25.09.2022 um 07:58 +0900 schrieb Taiju HIGASHI:
>> > > Ludovic Court=C3=A8s <ludo@gnu.org> writes:
>> > >
>> > > > 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=9Cesc=
ape
>> > > > hatch=E2=80=9D) but prepare for more conventional configuration
>> > > > bindings?
>> > >
>> > > By conventional configuration binding, do you mean adding
>> > > something
>> > > like home-fontconfig-configuration to provide a dedicated
>> > > fontconfig
>> > > configuration?
>> > I think Ludo means that we should provide the most useful options
>> > (like the fontconfig dirs) as dedicated record fields, while
>> > leaving an "extra-config" escape hatch, that can be used with SXML
>> > or a raw string for stuff that's too complicated (my personal
>> > preference would still be SXML over the raw string, but YMMV).
>>
>> I see.=C2=A0 For example,
>>
>> For example, would it be as follows?
>>
>> --8<---------------cut here---------------start------------->8---
>> (service home-fontconfig-service-type
>> =C2=A0 (home-fontconfig-configuration
>> =C2=A0=C2=A0=C2=A0 (dir "~/.config/fontconfig/my-fonts1.conf"))
>> =C2=A0 (extra-config
>> =C2=A0=C2=A0=C2=A0 (list
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "<dir>~/.config/fontconfig/my-fonts2.conf=
")))
>> --8<---------------cut here---------------end--------------->8---
> Since you can specify more than one dir, that'd be "dirs" or even
> something more helpful like "font-directories".  Note that those are
> directories and not config files.
>
> You corrected the extra-config thing in your reply, but also be aware
> of the extra-config as SXML option.
>
>>
>> > > I have been reading the DTD and think it might be a bit of a
>> > > challenge.
>> > > https://github.com/freedesktop/fontconfig/blob/e291fda7d42e5d6437955=
5097a066d9c2c4efce3/fonts.dtd
>> > >
>> > > However, I did notice one thing, and that is that there is an
>> > > include element.=C2=A0 I thought that if we had a configuration where
>> > > the include element could be added, we could handle most of the
>> > > use cases.  What do you think of this idea?
>> > I'd prefer extra-config over include =E2=80=93 extra-config doesn't ne=
ed to
>> > go through file-like objects and an additional layer of G-
>> > Expression quoting.
>> >
>> > Cheers
>>
>> It is difficult to determine which rules to define as records, but I
>> thought that if I only had includes, I could handle most use cases.
> Go for the obvious low-hanging fruits and typical use cases first.
> Don't just add a field that requires a depth of 3 or more to be useful.
>
>> For example, we assume that you will be able to write settings as
>> follows:
>>
>> --8<---------------cut here---------------start------------->8---
>> (service home-fontconfig-service-type
>> =C2=A0 (home-fontconfig-configuration
>> =C2=A0=C2=A0=C2=A0 (includes
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (include
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (path "~/.config/=
fontconfig/my-fonts1.conf")
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (ignore-missing #=
t))))))
>> --8<---------------cut here---------------end--------------->8---
>>
>> ref:
>> https://github.com/freedesktop/fontconfig/blob/e291fda7d42e5d64379555097=
a066d9c2c4efce3/fonts.dtd#L59-L74
>>
>> Would it also fit with your assumption if we could also specify
>> extra-config here?
>>
>> It is difficult to judge whether the ability to specify includes is
>> useful or not, though, since extra-config alone will do the job.
> Except for possibly some fringe use cases, include will be pointless if
> you have extra-config, which is a better include :)
>
> Cheers

I have designed a configuration interface with a typical font
configuration pattern. (it implemented yet.)

--8<---------------cut here---------------start------------->8---
(service home-fontconfig-service-type
         (home-fontconfig-configuration
          (font-directories
           (list "~/fonts"))
          (prefered-default-font
           (sans-serif "Noto Sans CJK JP")
           (serif "Noto Serif CJK JP")
           (monospace "PlemolJP Console"))
          (extra-config ; Also accepts lists of XML strings.
           `((match (@ (target font))
                    (edit (@ (mode assign)
                             (name antialias))
                          (bool true)))))))
--8<---------------cut here---------------end--------------->8---

This is assumed to be serialized below. (actually, it not pretty-printed.)

--8<---------------cut here---------------start------------->8---
<?xml version=3D'1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <dir>~/.guix-home/profile/share/fonts</dir>
  <dir>~/fonts</dir>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Sans CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Noto Serif CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>PlemolJP Console</family>
    </prefer>
  </alias>
  <match target=3D"font">
    <edit mode=3D"assign" name=3D"antialias">
      <bool>true</bool>
    </edit>
  </match>
</fontconfig>
--8<---------------cut here---------------end--------------->8---

How about this?

--=20
Cheers
Taiju