From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6ORUCxzc3WUIPgAAe85BDQ:P1 (envelope-from ) for ; Tue, 27 Feb 2024 13:57:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6ORUCxzc3WUIPgAAe85BDQ (envelope-from ) for ; Tue, 27 Feb 2024 13:57:00 +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="2dxiq6Z/"; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709038620; 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=HvWaPfW1GmLkFyeTRghsh6iWLcxC9QgNyFnCCexJd0Q=; b=Vnji9n4tBbnM2/fLOAbgXe1LdpfHQOEvVMPzHzZQGmfkf0AIxTCV2FDUHLJDlZCtWykBKg ecaT+9gP4teM1ENuI3jOqBdFnBG84EdsERFbAtc+ZzVIlIUbCRjJ4Zl/VZAgM1pNkK047F tWT7dJRUfOt4uJ2zdBIy8DBXcaF1m4B+NgZO+QbUnk+3u7Jy4Cnf2z4GI8xbAfCYwvEKvG HiUaGE9ccZ5uIYpkX0NVRIjo1W2XbkbAuzs33Dv1JZQ/OxsOQ+4lr1CUzqTsF9j2j8aYeR 1/LP3lE2krMxTx9U7XAgzPj/4qGrDube2c7bonYxLSakg4eLM37ra7b43eiPZw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b="2dxiq6Z/"; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709038620; a=rsa-sha256; cv=none; b=Vghbke02ebggxTVAa06DBcR6k+DqaM57b0v+KH97sXl6x2cXRSsY9+XyQfmtUW26pzqIQT QMm2z8VUlIAdYjZwmdTbeiJzgjsgrIgRc57vStpDyHzYcdRW58CVAixHUDJ1/nKbNb4cPZ UG0ZNxcQpxZS1lpHZgDYOnIjJqRu4gsAUWegw4VkYL8jMGf+WNB4cNxPtkE6KX3v9Z5atQ oSL7R7PW7hQEZaCXsAUWZM2VqvORGR5th0vF71fZBYepb23ZuWSDx+YOog51Zu5ULX2GkK 4tbctsAvURXMB7K0IvzChHIyvv4bLbu4j8BBJNVSc4zX9HFGmS2gyK1W3Q2/Hw== 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 F019F40572 for ; Tue, 27 Feb 2024 13:56:59 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rex0m-0004JQ-Sx; Tue, 27 Feb 2024 07:56:44 -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 1rex0l-0004Ft-UH for guix-patches@gnu.org; Tue, 27 Feb 2024 07:56:44 -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 1rex0l-0003bi-Ki for guix-patches@gnu.org; Tue, 27 Feb 2024 07:56:43 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rex14-0004oT-Gf; Tue, 27 Feb 2024 07:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69424] [PATCH 2/5] gnu: font-google-noto: Keep only variable fonts when available. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: all_but_last@163.com, iyzsong@envs.net, yangjiwei@protonmail.com, guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2024 12:57:02 +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?= , Jiwei YANG X-Debbugs-Original-Xcc: Zhu Zihao , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= , Jiwei YANG Received: via spool by 69424-submit@debbugs.gnu.org id=B69424.170903858918385 (code B ref 69424); Tue, 27 Feb 2024 12:57:02 +0000 Received: (at 69424) by debbugs.gnu.org; 27 Feb 2024 12:56:29 +0000 Received: from localhost ([127.0.0.1]:50942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rex0X-0004mT-DP for submit@debbugs.gnu.org; Tue, 27 Feb 2024 07:56:29 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:44622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rex0V-0004mH-5w for 69424@debbugs.gnu.org; Tue, 27 Feb 2024 07:56:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1709038544; 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=HvWaPfW1GmLkFyeTRghsh6iWLcxC9QgNyFnCCexJd0Q=; b=2dxiq6Z/aMWQUTZ3tmK4H+/cGAtmAestGqwvXkzHrXKejkKQpVbueEbL8WDMHOBleE6+S5 ri04TybhaBPe/kjEddBNesroMhQDSx7ACDla38s48I8WxFim4h3wP5FHBtcpIHoRHZ+1cb J3ScrnPeZtkthgv/YUpnuRaok3FQfcNrn3qhSDD3WmongjgI0FOzY6h9hS5Il41mHpuZ/Q Jc5Pb/6MhLZZgUnV7urpKFWCd9yXgzLVsmHDHPYUE0RecXNOLTnNja/rvr3vHyEq7cVcHO zvRgDs3WVBlv9zh7zZwWinlk8R0RJn5/7vtfICVRfeRTpqLRx6hghWgj+FIYGg== Date: Tue, 27 Feb 2024 20:54:23 +0800 Message-ID: <3621bba8af092abc980ff31e8ac578b47b59c50b.1709038102.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-Spam-Score: -6.27 X-Spam-Score: -6.27 X-Migadu-Queue-Id: F019F40572 X-Migadu-Scanner: mx13.migadu.com X-TUID: i8W5sZoEeEYA * gnu/packages/fonts.scm (font-google-noto)[arguments]: When available, keep only variable fonts. Suggested-by: Jiwei YANG Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46 --- gnu/packages/fonts.scm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 72bf0124c4..1ed648f5a2 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -1092,6 +1092,48 @@ (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) + (srfi srfi-26)) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'delete-extra-fonts + (lambda _ + (define (scan-directory name) + (scandir name (lambda (file) + (not (member file '("." ".." "LICENSE")))))) + (define (delete-extra-font-formats variant) + "Keep one font format, variable or OTF or TTF." + (with-directory-excursion variant + (let ((formats (scan-directory "."))) + (for-each + delete-file-recursively + (cond + ((member "variable-ttf" formats) + (delete "variable-ttf" formats)) + ((member "otf" formats) + (delete "otf" formats)) + ((member "ttf" formats) + (delete "ttf" formats))))))) + (define (delete-extra-font-variants font) + "Keep one font variant, full or unhinted." + (with-directory-excursion font + (let ((variants (scan-directory "."))) + (for-each + delete-file-recursively + (cond + ((member "full" variants) + (delete-extra-font-formats "full") + (delete "full" variants)) + ((member "unhinted" variants) + (delete-extra-font-formats "unhinted") + (delete "unhinted" variants))))))) + (with-directory-excursion "fonts" + (for-each delete-extra-font-variants (scan-directory ".")))))))) (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