From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 AGOlAbciOGP2CAEAbAwnHQ (envelope-from ) for ; Sat, 01 Oct 2022 13:21:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UNHIAbciOGMADAEA9RJhRA (envelope-from ) for ; Sat, 01 Oct 2022 13:21:27 +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 963CEE59B for ; Sat, 1 Oct 2022 13:21:26 +0200 (CEST) Received: from localhost ([::1]:47218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeaYf-0001TE-Mh for larch@yhetil.org; Sat, 01 Oct 2022 07:21:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeaYI-0001SS-LT for guix-patches@gnu.org; Sat, 01 Oct 2022 07:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeaYI-0003LN-7P for guix-patches@gnu.org; Sat, 01 Oct 2022 07:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oeaYI-0005eu-0Z for guix-patches@gnu.org; Sat, 01 Oct 2022 07:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57963] [PATCH v4 2/2] home: fontutils: Support user's fontconfig. Resent-From: Taiju HIGASHI Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Oct 2022 11:21:01 +0000 Resent-Message-ID: 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.prikler@gmail.com Cc: ludo@gnu.org, 57963@debbugs.gnu.org, andrew@trop.in Received: via spool by 57963-submit@debbugs.gnu.org id=B57963.166462320221638 (code B ref 57963); Sat, 01 Oct 2022 11:21:01 +0000 Received: (at 57963) by debbugs.gnu.org; 1 Oct 2022 11:20:02 +0000 Received: from localhost ([127.0.0.1]:43795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeaXJ-0005cl-Tn for submit@debbugs.gnu.org; Sat, 01 Oct 2022 07:20:02 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:55200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeaXH-0005cN-PY for 57963@debbugs.gnu.org; Sat, 01 Oct 2022 07:20:00 -0400 Received: by mail-pj1-f48.google.com with SMTP id 70so6298621pjo.4 for <57963@debbugs.gnu.org>; Sat, 01 Oct 2022 04:19:59 -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=h9Zt8CGjGQSIuO2XegoXY83Brpqw0Ta5TNSxduk6BlI=; b=xnCkMw2MyKOb6f0t5OQyCZiLuKT3frYGzkmRsLQTyIYeQ+nXFfhq/QGHCY8Pt8CBYj pWrUN8LzmvWxBgCEr8WFZs9oc6vbDN2lG9OH7Y5gDlI0FR6mQsGt9md6vuCjU+lgeu96 d6IO5UdEhH+/PYEKiIMaR4cGEYM3c8P/saNP6MfWjlOPUH/ctY0bxIMtc7To9waIEbkI 63EyWMXE1Jeg3uA6QkaH81XFpg+z+abhsRKYkQV2G2GirfOtoTFQwJ2XI0athxKJmcRf 8rScM0wUD8qUr+yqZBCXOzgKeJkU4P0pZazKT4vaN1roFiuSOJUwSOzu2/EfRfUu2O6Z uykA== 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=h9Zt8CGjGQSIuO2XegoXY83Brpqw0Ta5TNSxduk6BlI=; b=ZTEEUc4Gyvq3s4eokjVNJMm+rLg+QOeGDN7JHfMYpFuPGp1SS5eD9/k/tXp6FO8nHx +8gUkYvirdPUNsWm5myyj+a/0lID31fmdxuMqYuaUx7X52xW98i6ByE3Jdpq8UNw+4gE TbkJ8/jzC5ISk8VOq/Qiz9BYdXjTygiPGUNxURnYRwqeYfuC1qEhasej9FeHgL7B8iS5 wNHYRLC/Xit+boCyq6e1mM3J2aS04YqA4PbczyfurcstVYqnr6ZTHY7sOHQbOkE4Bs2x 04THExNTtnss2lFZHcgVH6Izh31E4J143CbJkB/755Ptz7l1enDLFOonvQAcynsW/yze SA5g== X-Gm-Message-State: ACrzQf2N/rjEiA4A67dNwCAIqAC7YGSuWrSZRzYd4S3PCZ2OZRpkDcM9 2joVDnkQebtIJEDTjGbp698pFQ== X-Google-Smtp-Source: AMsMyM6MsbMve/6eoCNJeY1o2CoozOrQj03GZf9S7yZ1HrucJRZrvKxVC3N3/7vfVJ7GBCejuzj37g== X-Received: by 2002:a17:90b:4d08:b0:20a:6861:352c with SMTP id mw8-20020a17090b4d0800b0020a6861352cmr2880826pjb.225.1664623193990; Sat, 01 Oct 2022 04:19:53 -0700 (PDT) Received: from Taix ([240b:253:ec40:2400:b7d1:436e:2d61:e925]) by smtp.gmail.com with ESMTPSA id m16-20020a170902db1000b00176d8e33601sm3670100plx.203.2022.10.01.04.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Oct 2022 04:19:53 -0700 (PDT) From: Taiju HIGASHI References: <20220929143633.28844-1-higashi@taiju.info> <20220929143633.28844-2-higashi@taiju.info> <3e28e656526b901a3fd099d1cd180528f24e15e7.camel@gmail.com> Date: Sat, 01 Oct 2022 20:19:51 +0900 In-Reply-To: <3e28e656526b901a3fd099d1cd180528f24e15e7.camel@gmail.com> (liliana prikler's message of "Fri, 30 Sep 2022 20:34:08 +0200") Message-ID: <87o7uvrdt4.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=iso-8859-1 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664623286; 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=h9Zt8CGjGQSIuO2XegoXY83Brpqw0Ta5TNSxduk6BlI=; b=TM/WcEiLAnR/0bmm2UQhrjZ1ZRrMFNaof+kQDbTOtMiCAXqT6A57NB9pFwJxSyH56QGeQN 3lhApqYOgs0Otp7MNndQ/0wp4lfB/spg30RfuKLhBd/oV7zFYmdYf1IDBnu4tXghEo01I3 zk6uD9QsoGUQ3mkB+3700rgZJtAlJ93uHMHNHv0Bk9BH4Qd9tCSzIDqLKZ/lMsLy2UoeVv nFplD4tqo/vW0Cv4VgGuQXR9Ha//biJb8apML2l+B1eYSsA+Fatsyfwq9zEbuCU4ho8Alo DUaUHq36OG4LGPhdTxhwaCEeo/Q025tRH42BhfL0U7G2U8cwfs+um4XszebNkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664623286; a=rsa-sha256; cv=none; b=hYZWqBUixqtzEj9mGMAPbBXt87k+i5OCurBh7ROKp86NPmY31nwoOJ8VBZ1XC6+h9kGUA6 KIKHsWLfrn5yAnPf90UdZg6H8vM0gLWDY7wd7d5Dvi3Gle6WlI5NQWSv2Zb69Q8RI9/QGt fjG3/ZJQYEv06shN3ldxbAXN/4t9LFOE1K6lemRO3xX4Vow269N5FbkvNM0TJYqGlu4UDT EEKnMNDMLzus1UdIk9DAATabrjMdkru6tGcD4uqFZh66nmnLheVUwKU/Ji0BJ3jqnzJFon pjlAAeLsA6bXhjobZi5//N600Vgo7dQxU5BYHgcK8Qh+XuNZ0g/440UnCeh45w== 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=xnCkMw2M; 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: 2.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=taiju-info.20210112.gappssmtp.com header.s=20210112 header.b=xnCkMw2M; 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: 963CEE59B X-Spam-Score: 2.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: 6r+0VFBmwqkP liliana.prikler@gmail.com writes: > Am Donnerstag, dem 29.09.2022 um 23:36 +0900 schrieb Taiju HIGASHI: >> * gnu/home/services/fontutils.scm: Support user's fontconfig. >> --- >> =A0gnu/home/services/fontutils.scm | 86 ++++++++++++++++++++++++++++++- >> -- >> =A01 file changed, 80 insertions(+), 6 deletions(-) >> >> diff --git a/gnu/home/services/fontutils.scm >> b/gnu/home/services/fontutils.scm >> index 6062eaed6a..32127740f6 100644 >> --- a/gnu/home/services/fontutils.scm >> +++ b/gnu/home/services/fontutils.scm >> @@ -1,6 +1,7 @@ >> =A0;;; GNU Guix --- Functional package management for GNU >> =A0;;; Copyright =A9 2021 Andrew Tropin >> =A0;;; Copyright =A9 2021 Xinglu Chen >> +;;; Copyright =A9 2022 Taiju HIGASHI >> =A0;;; >> =A0;;; This file is part of GNU Guix. >> =A0;;; >> @@ -20,9 +21,16 @@ >> =A0(define-module (gnu home services fontutils) >> =A0=A0 #:use-module (gnu home services) >> =A0=A0 #:use-module (gnu packages fontutils) >> +=A0 #:use-module (gnu services configuration) >> =A0=A0 #:use-module (guix gexp) >> +=A0 #:use-module (guix records) >> +=A0 #:use-module (srfi srfi-1) >> +=A0 #:use-module (sxml simple) >> +=A0 #:use-module (ice-9 match) >> >> -=A0 #:export (home-fontconfig-service-type)) >> +=A0 #:export (home-fontconfig-service-type >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 home-fontconfig-configuration >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 default-font)) >> >> =A0;;; Commentary: >> =A0;;; >> @@ -33,15 +41,81 @@ (define-module (gnu home services fontutils) >> =A0;;; >> =A0;;; Code: >> >> -(define (add-fontconfig-config-file he-symlink-path) >> +(define (default-font-sanitizer type) >> +=A0 (lambda (value) >> +=A0=A0=A0 (if (null? value) >> +=A0=A0=A0=A0=A0=A0=A0 value >> +=A0=A0=A0=A0=A0=A0=A0 `(alias >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0 (family ,type) >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0 (prefer >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (family ,value)))))) >> + >> +(define-record-type* default-font >> +=A0 make-default-font >> +=A0 default-font? >> +=A0 (serif default-font-serif >> +=A0=A0=A0=A0=A0=A0=A0=A0 (default '()) >> +=A0=A0=A0=A0=A0=A0=A0=A0 (sanitize (default-font-sanitizer 'serif))) >> +=A0 (sans-serif defalut-font-sans-serif > default-font-sans-serif >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (default '()) >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (sanitize (default-font-sanitiz= er 'sans-serif))) >> +=A0 (monospace default-font-monospace >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (default '()) >> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (sanitize (default-font-sanitizer = 'monospace)))) > Rather than having a null default and sanitizing the field as here, can > we have an #f default and omit the field? > > Btw. I'm not sure whether making this an extra record is the right > idea. Wouldn't "default-(serif|sans-serif|monospace)-family" at the > root make more sense? > > Cheers Do you mean to write as follows? --8<---------------cut here---------------start------------->8--- (home-environment (packages (list font-google-noto)) (services (append (list (service home-bash-service-type)) (modify-services %home-base-services (home-fontconfig-service-type config =3D> (home-fontconfig-configuration (font-directories (list "~/fonts")) (default-serif-family "Noto Serif CJK JP") (default-sans-serif-family "Noto Sans CJK JP") (extra-config `((match (@ (target font)) (edit (@ (mode assign) (name antialias)) (bool true))))))))))) --8<---------------cut here---------------end--------------->8--- Cheers, --=20 Taiju