From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id IEgpI7g632UyEgAA62LTzQ:P1 (envelope-from ) for ; Wed, 28 Feb 2024 14:52:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id IEgpI7g632UyEgAA62LTzQ (envelope-from ) for ; Wed, 28 Feb 2024 14:52:56 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=hvew+DF4; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709128376; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=M3yaA3QTBkKFg+jr1fn3xfUHUVFered2vb1S8Pa+4MQ=; b=dUUZkm3876nWD7DA3XeIdXa/aiX99L3P3qNHI3C5P4PSHvGABGBYsI1G871xVY+fxydiZH rsEMYxPqyLNL5wbnuarj8/lrEPpEintjIwInNJimwtNZxlE0hGeuJda+gbsMgPO7SE7Gty C3lNIP8bqaMDm9GshO96+32AwY4FZ9/pcDu18H5a5irFttz6ppZg9S951jQFnED9dQ70+F Ww6GTtoo6SHzoIo7geTRmjBlXIea0DJ0gNnddW1cYRMZZuiocLSDbfDyYFLzyYao1qRlz1 9VA+wVSomw4LGh/WkKjXNeOG7qoiZiqY8V8EtJ5FjLR4QHbTKvA04Qy1ZU0m6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=hvew+DF4; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709128376; a=rsa-sha256; cv=none; b=BPIqXIryq9ql7VvlpSAXarTtsJLkDkk7pFCp9pIR+ip88Prr2vPgNdDRUkhDg20nOWY2Rc zfeHLSVpDBpC/9PFzykYuDHgDO293AV7FRcRLxXJTLL71IRQ6WoPXukT90HFr9/KlQrgio ZFTJ3GwdCdJvYk9en1Q8ymdtQx51bDwkAapyvrU6BkoX5FatEzU9+kjSbL+VbmfX5eeWqO z6ISwS8bJRKg70BtlKUn9NeJ8MymT4wn4uPYg1WZFXOg4J8Ka1jibtXWq5xd9SVYrUh933 WMzcn/v1nZpKmOKQLYSRvWnBXaPmFgIPD29XwtSz+58yxfYnRUYnIH5dSWoMtw== 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 7A63326360 for ; Wed, 28 Feb 2024 14:52:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfKMV-0003kM-C5; Wed, 28 Feb 2024 08:52:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfKMU-0003k8-02 for guix-patches@gnu.org; Wed, 28 Feb 2024 08:52:42 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfKMT-0000tH-Kv for guix-patches@gnu.org; Wed, 28 Feb 2024 08:52:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfKMo-00082K-0z; Wed, 28 Feb 2024 08:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69424] [PATCH v3 2/5] gnu: font-google-noto: Prefer variable fonts and split outputs. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: all_but_last@163.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Wed, 28 Feb 2024 13:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69424 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69424@debbugs.gnu.org Cc: Hilton Chain , Jiwei YANG , Zhu Zihao , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-Xcc: Zhu Zihao , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Received: via spool by 69424-submit@debbugs.gnu.org id=B69424.170912837130866 (code B ref 69424); Wed, 28 Feb 2024 13:53:01 +0000 Received: (at 69424) by debbugs.gnu.org; 28 Feb 2024 13:52:51 +0000 Received: from localhost ([127.0.0.1]:41216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfKMd-00081m-EF for submit@debbugs.gnu.org; Wed, 28 Feb 2024 08:52:51 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:43486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfKMb-00081Y-AN for 69424@debbugs.gnu.org; Wed, 28 Feb 2024 08:52:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1709127145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M3yaA3QTBkKFg+jr1fn3xfUHUVFered2vb1S8Pa+4MQ=; b=hvew+DF4QjCENgPtvpOCpuTAp+U2BndH+uwAFspxrG1cS3CK1lqVQVlj5Q1W+RitZLr2mB ac0PIyTrulv5rFkb48f/LcF7Sa0dYfQ78M2WXqBjHOf1+WE7DNtNNqqfx/D3LuuHWqpEbh Pcg7DacYDPWngkP8s2zuPrMcx5pO9ViV48/cTdC0JtjA87Y681nNqhmTTfvs+PfbBlkQ5F CZ7rCke5oejVHpgtDEOn+BD5f7Kjes73dTNAHsadXsI4QJlQ3uFY4/UXI5jUlUmJjV5In2 vq41wuCUiWeKTMfr61OLk8YTkA29NOqO06hTnG4Ra06cPD9rrBrpfgEvq0/Psw== Date: Wed, 28 Feb 2024 21:32:19 +0800 Message-ID: <5eada4da5298fdaba9d6a05b411161637b3a42a4.1709126510.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: -- 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: , Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -4.41 X-Spam-Score: -4.41 X-Migadu-Queue-Id: 7A63326360 X-TUID: nG2NZs7ruk+E * gnu/packages/fonts.scm (font-google-noto)[outputs]: Add "ttf". [arguments]<#:phase>: Move hinted TTFs into it. Prefer variable fonts. Suggested-by: Jiwei YANG Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46 --- gnu/packages/fonts.scm | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 72bf0124c4..4f9400047f 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -1092,6 +1092,51 @@ (define-public font-google-noto (sha256 (base32 "087jg8ahpq35xwyrmvm9ivxl0wjic2j4r28bbrwqmgdva9brms40")))) (build-system font-build-system) + (arguments + (list + #:modules + '((guix build font-build-system) + (guix build utils) + (ice-9 ftw)) + #:phases + #~(modify-phases %standard-phases + (replace 'install + (lambda _ + (define* (install source #:optional (output #$output)) + (let ((%install (assoc-ref %standard-phases 'install))) + (with-directory-excursion source + (%install #:outputs `(("out" . ,output)))))) + + (define (scan-directory name) + (scandir name (lambda (file) + (not (member file '("." ".." "LICENSE")))))) + + (define (install-font-variant variant) + "Given font variant VARIANT, install one of its formats, +variable TTF or OTF or TTF." + (with-directory-excursion variant + (let ((formats (scan-directory "."))) + (cond + ((member "variable-ttf" formats) + (install "variable-ttf")) + ((member "otf" formats) + (install "otf")) + ((member "ttf" formats) + (install "ttf")))))) + + (define (install-font font) + "Given FONT, install one of its variants, either full or +unhinted, and install its hinted variant into 'ttf' output. According to the +source, unhinted and hinted variants are always available." + (with-directory-excursion font + (if (member "full" (scan-directory ".")) + (install-font-variant "full") + (install-font-variant "unhinted")) + (install "hinted" #$output:ttf))) + + (with-directory-excursion "fonts" + (for-each install-font (scan-directory ".")))))))) + (outputs '("out" "ttf")) (home-page "https://www.google.com/get/noto/") (synopsis "Fonts to cover all languages") (description "Google Noto Fonts is a family of fonts designed to support -- 2.41.0