[PATCH 0/5] Update Noto fonts and switch them to variable fonts (77% size reduced).

  • Done
  • quality assurance status badge
Details
2 participants
  • Hilton Chain
  • Jiwei YANG
Owner
unassigned
Submitted by
Hilton Chain
Severity
normal
H
H
Hilton Chain wrote on 27 Feb 13:49 +0100
(address . guix-patches@gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
cover.1709038102.git.hako@ultrarare.space
Before:
Toggle snippet (17 lines)
$ guix size font-google-noto
store item total self
/gnu/store/jcaffgp0yzjh3y0c6lfgdazhmrbh26nn-font-google-noto-23.11.1 564.2 564.2 100.0%
total: 564.2 MiB

$ guix size font-google-noto-sans-cjk
store item total self
/gnu/store/afgaar19vjahvxxnx2xy7807l74v62wj-font-google-noto-sans-cjk-2.004 124.6 124.6 100.0%
total: 124.6 MiB

$ guix size font-google-noto-serif-cjk
store item total self
/gnu/store/qrw5hdllxp8r006rzkplma7r5is5li7g-font-google-noto-serif-cjk-2.001 173.2 173.2 100.0%
total: 173.2 MiB


After:
Toggle snippet (16 lines)
$ ./pre-inst-env guix size font-google-noto
store item total self
/gnu/store/fpmdqfgsrjmkp6adjgpxzsvl9x2islxw-font-google-noto-24.2.1 81.5 81.5 100.0%
total: 81.5 MiB

$ ./pre-inst-env guix size font-google-noto-sans-cjk
store item total self
/gnu/store/py51ihmwln5ys69lm37wglqw8sq6139b-font-google-noto-sans-cjk-2.004 61.6 61.6 100.0%
total: 61.6 MiB

$ ./pre-inst-env guix size font-google-noto-serif-cjk
store item total self
/gnu/store/nfhsf0dkd66s3r2lqi76qbh3bgazyf5v-font-google-noto-serif-cjk-2.002 54.2 54.2 100.0%
total: 54.2 MiB

Hilton Chain (5):
gnu: font-google-noto: Update to 24.2.1.
gnu: font-google-noto: Keep only variable fonts when available.
gnu: font-google-noto-emoji: Update to 2.042.
gnu: font-google-noto-sans-cjk: Switch to variable fonts.
gnu: font-google-noto-serif-cjk: Update to 2.002.

gnu/packages/fonts.scm | 89 +++++++++++++++++++++++++++++++++++-------
1 file changed, 75 insertions(+), 14 deletions(-)


base-commit: 75bad75367fcf2c289fae3b40dbcc850f92177be
--
2.41.0
H
H
Hilton Chain wrote on 27 Feb 13:54 +0100
[PATCH 2/5] gnu: font-google-noto: Keep only variable fonts when available.
(address . 69424@debbugs.gnu.org)
3621bba8af092abc980ff31e8ac578b47b59c50b.1709038102.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto)[arguments]: When available, keep
only variable fonts.

Suggested-by: Jiwei YANG <yangjiwei@protonmail.com>
Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46
---
gnu/packages/fonts.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (53 lines)
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
H
H
Hilton Chain wrote on 27 Feb 13:54 +0100
[PATCH 3/5] gnu: font-google-noto-emoji: Update to 2.042.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
55c7838b2dfebd7b7205b3aa0d2c22a1b18a2061.1709038102.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-emoji): Update to 2.042.
[arguments]<#:phases>: Remove 'remove-unsupported.
Replace install phase instead.

Change-Id: I76cfbf3f8d34c484ed59b99969da7d93aaf41d72
---
gnu/packages/fonts.scm | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 1ed648f5a2..472853afa4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1144,7 +1144,7 @@ (define-public font-google-noto
(define-public font-google-noto-emoji
(package
(name "font-google-noto-emoji")
- (version "2.038")
+ (version "2.042")
(source
(origin
(method git-fetch)
@@ -1154,7 +1154,7 @@ (define-public font-google-noto-emoji
(file-name (git-file-name name version))
(sha256
(base32
- "1rgmcc6nqq805iqr8kvxxlk5cf50q714xaxk3ld6rjrd69kb8ix9"))))
+ "17i7awyqz9jv0j2blcf0smmpas375c3pdhjv1zqzl861g8qm1lm2"))))
(build-system font-build-system)
(arguments
(list
@@ -1164,11 +1164,10 @@ (define-public font-google-noto-emoji
(lambda _
;; Note this ensures the correct license file is installed.
(chdir "fonts")))
- (add-after 'enter-font-directory 'remove-unsupported
- (lambda* _
- (delete-file "NotoColorEmoji_WindowsCompatible.ttf")
- (delete-file "Noto-COLRv1-noflags.ttf")
- (delete-file "Noto-COLRv1.ttf"))))))
+ (replace 'install
+ (lambda _
+ (let (dir ((string-append #$output "/share/fonts/truetype")))
+ (install-file "NotoColorEmoji.ttf" dir)))))))
(home-page "https://fonts.google.com/noto/specimen/Noto+Color+Emoji")
(synopsis "Font for rendering color emoji characters")
(description
--
2.41.0
H
H
Hilton Chain wrote on 27 Feb 13:54 +0100
[PATCH 4/5] gnu: font-google-noto-sans-cjk: Switch to variable fonts.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
d7266d9c1cbde1aaa598f602bb9b80c26ba94e12.1709038102.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-sans-cjk)[source]: Switch to
variable fonts.
[arguments]<#:phases>: Only install ttc files.

Change-Id: I996d75b7892333bc69d21af53a5243a442e3a6b3
---
gnu/packages/fonts.scm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 472853afa4..69a2c62474 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1184,11 +1184,23 @@ (define-public font-google-noto-sans-cjk
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Sans"
- version "/03_NotoSansCJK-OTC.zip"))
+ version "/01_NotoSansCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1v9yda7r98g4a3pk0y3cjbgc1i2lv4ax0f0v6aqasfzz4ldlx3sj"))))
+ (base32 "1ka37kqyd0sfqwk485nv6ihrdjl5xycr38m4jq40r2lzmpmkmqym"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((dir (string-append #$output "/share/fonts/truetype")))
+ (with-directory-excursion "OTC"
+ (for-each
+ (lambda (font)
+ (install-file font dir))
+ '("NotoSansCJK-VF.otf.ttc"
+ "NotoSansMonoCJK-VF.otf.ttc")))))))))
(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
H
H
Hilton Chain wrote on 27 Feb 13:54 +0100
[PATCH 5/5] gnu: font-google-noto-serif-cjk: Update to 2.002.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
047da485326b71bb3e83610fe7a17275ff0a4e74.1709038102.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-serif-cjk): Update to 2.002.
[source]: Switch to variable fonts.
[arguments]<#:phases>: Only install ttc files.

Change-Id: Id22401ce85028951b6044ba418dbad764d581f01
---
gnu/packages/fonts.scm | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 69a2c62474..61b3118529 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1212,17 +1212,25 @@ (define-public font-google-noto-sans-cjk
(define-public font-google-noto-serif-cjk
(package
(name "font-google-noto-serif-cjk")
- (version "2.001")
+ (version "2.002")
(source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Serif"
- version "/04_NotoSerifCJKOTC.zip"))
+ version "/02_NotoSerifCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1l6r3sz2s0vcyfx6ria7wqcq45zp40gxgg97lh8hpmajhzw301ig"))))
+ (base32 "007jk7rmfapq5zq4ji9d1l5gpp34p98l9ylhiw33q42d66v2g717"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((dir (string-append #$output "/share/fonts/truetype")))
+ (with-directory-excursion "OTC"
+ (install-file "NotoSerifCJK-VF.otf.ttc" dir))))))))
(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
H
H
Hilton Chain wrote on 27 Feb 13:54 +0100
[PATCH 1/5] gnu: font-google-noto: Update to 24.2.1.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
bb173c20e56ff88d8eca52fe9d132c38c928e891.1709038102.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto): Update to 24.2.1.

Change-Id: I238f914388a2d808b817de1252ba8ee84c6299bd
---
gnu/packages/fonts.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 2cc420f7ba..72bf0124c4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1081,7 +1081,7 @@ (define-public font-gnu-unifont
(define-public font-google-noto
(package
(name "font-google-noto")
- (version "23.11.1")
+ (version "24.2.1")
(source
(origin
(method git-fetch)
@@ -1090,7 +1090,7 @@ (define-public font-google-noto
(commit (string-append "noto-monthly-release-" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0vvxhky35l4i0ha60yw0gj26f3v33hpf2zax17yyj16mww4cn4d8"))))
+ (base32 "087jg8ahpq35xwyrmvm9ivxl0wjic2j4r28bbrwqmgdva9brms40"))))
(build-system font-build-system)
(home-page "https://www.google.com/get/noto/")
(synopsis "Fonts to cover all languages")
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 0/5] Update Noto fonts and switch them to variable fonts (77% size reduced).
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
cover.1709089250.git.hako@ultrarare.space
V1->V2: Simplify phases and add extra outputs.

Toggle snippet (19 lines)
$ ./pre-inst-env guix build font-google-noto | xargs guix size
store item total self
/gnu/store/3xvvlfcffnyp0qdczlqjjzzwb6ylr8dx-font-google-noto-24.2.1-ttf 431.3 431.3 87.1%
/gnu/store/668z8k5qw3prsm7lhk33wym1hszdc4r3-font-google-noto-24.2.1 63.8 63.8 12.9%
total: 495.1 MiB

$ ./pre-inst-env guix build font-google-noto-sans-cjk | xargs guix size
store item total self
/gnu/store/im0c6mgyxnvbz4h9dc22vg6h3lqmh9c6-font-google-noto-sans-cjk-2.004-otf 340.6 340.6 84.7%
/gnu/store/7ihawxmfk5z9ji544l6i1nh0is315h9q-font-google-noto-sans-cjk-2.004 61.6 61.6 15.3%
total: 402.2 MiB

$ ./pre-inst-env guix build font-google-noto-serif-cjk | xargs guix size
store item total self
/gnu/store/qp5d7yrq3vnmfil1y4m2gbz8z114w6dw-font-google-noto-serif-cjk-2.002-otf 343.7 343.7 86.4%
/gnu/store/xr6w9vfbqval1g5238b3d9wcp7vgcydv-font-google-noto-serif-cjk-2.002 54.2 54.2 13.6%
total: 397.9 MiB

Before:
Toggle snippet (8 lines)
$ guix size font-google-noto font-google-noto-sans-cjk font-google-noto-serif-cjk
store item total self
/gnu/store/jcaffgp0yzjh3y0c6lfgdazhmrbh26nn-font-google-noto-23.11.1 564.2 564.2 65.5%
/gnu/store/qrw5hdllxp8r006rzkplma7r5is5li7g-font-google-noto-serif-cjk-2.001 173.2 173.2 20.1%
/gnu/store/afgaar19vjahvxxnx2xy7807l74v62wj-font-google-noto-sans-cjk-2.004 124.6 124.6 14.5%
total: 862.0 MiB

After:
Toggle snippet (11 lines)
$ ./pre-inst-env guix size \
/gnu/store/668z8k5qw3prsm7lhk33wym1hszdc4r3-font-google-noto-24.2.1 \
/gnu/store/7ihawxmfk5z9ji544l6i1nh0is315h9q-font-google-noto-sans-cjk-2.004 \
/gnu/store/xr6w9vfbqval1g5238b3d9wcp7vgcydv-font-google-noto-serif-cjk-2.002
store item total self
/gnu/store/668z8k5qw3prsm7lhk33wym1hszdc4r3-font-google-noto-24.2.1 63.8 63.8 35.5%
/gnu/store/7ihawxmfk5z9ji544l6i1nh0is315h9q-font-google-noto-sans-cjk-2.004 61.6 61.6 34.3%
/gnu/store/xr6w9vfbqval1g5238b3d9wcp7vgcydv-font-google-noto-serif-cjk-2.002 54.2 54.2 30.2%
total: 179.5 MiB

Hilton Chain (5):
gnu: font-google-noto: Update to 24.2.1.
gnu: font-google-noto: Prefer variable fonts and split outputs.
gnu: font-google-noto-emoji: Update to 2.042.
gnu: font-google-noto-sans-cjk: Switch to variable fonts.
gnu: font-google-noto-serif-cjk: Update to 2.002.

gnu/packages/fonts.scm | 93 +++++++++++++++++++++++++++++++++++-------
1 file changed, 79 insertions(+), 14 deletions(-)


base-commit: 8c0282cf543fe205a5b89201cd7bb8889121a07c
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 1/5] gnu: font-google-noto: Update to 24.2.1.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
f8184e40c68c783c4f93d4903b8f509c6897378c.1709089250.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto): Update to 24.2.1.

Change-Id: I238f914388a2d808b817de1252ba8ee84c6299bd
---
gnu/packages/fonts.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 2cc420f7ba..72bf0124c4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1081,7 +1081,7 @@ (define-public font-gnu-unifont
(define-public font-google-noto
(package
(name "font-google-noto")
- (version "23.11.1")
+ (version "24.2.1")
(source
(origin
(method git-fetch)
@@ -1090,7 +1090,7 @@ (define-public font-google-noto
(commit (string-append "noto-monthly-release-" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0vvxhky35l4i0ha60yw0gj26f3v33hpf2zax17yyj16mww4cn4d8"))))
+ (base32 "087jg8ahpq35xwyrmvm9ivxl0wjic2j4r28bbrwqmgdva9brms40"))))
(build-system font-build-system)
(home-page "https://www.google.com/get/noto/")
(synopsis "Fonts to cover all languages")
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 2/5] gnu: font-google-noto: Prefer variable fonts and split outputs.
(address . 69424@debbugs.gnu.org)
236164f917c76f445814e3cdf9bce736c7798ef9.1709089250.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto)
[arguments]<#:phase>: Only install variable fonts to "out" when available.
Install hinted TTFs into "ttf" output.
[outputs]: Add "ttf".

Suggested-by: Jiwei YANG <yangjiwei@protonmail.com>
Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46
---
gnu/packages/fonts.scm | 44 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (57 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 72bf0124c4..9a268364d7 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1092,6 +1092,50 @@ (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
+ (assoc-ref %standard-phases 'install))
+ (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)
+ (with-directory-excursion "variable-ttf"
+ (install #:outputs `(("out" . ,#$output)))))
+ ((member "otf" formats)
+ (with-directory-excursion "otf"
+ (install #:outputs `(("out" . ,#$output)))))
+ ((member "ttf" formats)
+ (with-directory-excursion "ttf"
+ (install #:outputs `(("out" . ,#$output)))))))))
+ (define (install-font font)
+ "Given font FONT, install one of its variants, full or unhinted,
+and install its hinted variant into 'ttf' output.
+
+unhinted and hinted variants are always available."
+ (with-directory-excursion font
+ (if (member "full" (scan-directory "."))
+ (install-font-variant "full")
+ (install-font-variant "unhinted"))
+ (with-directory-excursion "hinted"
+ (install #:outputs `(("out" . ,#$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
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 3/5] gnu: font-google-noto-emoji: Update to 2.042.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
9d304f9b1f03de1ee28ced3edcec1fa102bdd290.1709089250.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-emoji): Update to 2.042.
[arguments]<#:phases>: Remove 'remove-unsupported.
Replace install phase instead.

Change-Id: I76cfbf3f8d34c484ed59b99969da7d93aaf41d72
---
gnu/packages/fonts.scm | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 9a268364d7..9674f9bab5 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1146,7 +1146,7 @@ (define-public font-google-noto
(define-public font-google-noto-emoji
(package
(name "font-google-noto-emoji")
- (version "2.038")
+ (version "2.042")
(source
(origin
(method git-fetch)
@@ -1156,7 +1156,7 @@ (define-public font-google-noto-emoji
(file-name (git-file-name name version))
(sha256
(base32
- "1rgmcc6nqq805iqr8kvxxlk5cf50q714xaxk3ld6rjrd69kb8ix9"))))
+ "17i7awyqz9jv0j2blcf0smmpas375c3pdhjv1zqzl861g8qm1lm2"))))
(build-system font-build-system)
(arguments
(list
@@ -1166,11 +1166,10 @@ (define-public font-google-noto-emoji
(lambda _
;; Note this ensures the correct license file is installed.
(chdir "fonts")))
- (add-after 'enter-font-directory 'remove-unsupported
- (lambda* _
- (delete-file "NotoColorEmoji_WindowsCompatible.ttf")
- (delete-file "Noto-COLRv1-noflags.ttf")
- (delete-file "Noto-COLRv1.ttf"))))))
+ (replace 'install
+ (lambda _
+ (let (dir ((string-append #$output "/share/fonts/truetype")))
+ (install-file "NotoColorEmoji.ttf" dir)))))))
(home-page "https://fonts.google.com/noto/specimen/Noto+Color+Emoji")
(synopsis "Font for rendering color emoji characters")
(description
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 4/5] gnu: font-google-noto-sans-cjk: Switch to variable fonts.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
b819592c2c40e8b31f9d23a94bceab6f723746cc.1709089250.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-sans-cjk)
[source]: Switch to variable fonts.
[arguments]<#:phases>: Keep only TTCs in "out".
Install OTFs into "otf" output.
[outputs]: Add "otf".

Change-Id: I996d75b7892333bc69d21af53a5243a442e3a6b3
---
gnu/packages/fonts.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 9674f9bab5..356103c6a1 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1186,11 +1186,22 @@ (define-public font-google-noto-sans-cjk
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Sans"
- version "/03_NotoSansCJK-OTC.zip"))
+ version "/01_NotoSansCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1v9yda7r98g4a3pk0y3cjbgc1i2lv4ax0f0v6aqasfzz4ldlx3sj"))))
+ (base32 "1ka37kqyd0sfqwk485nv6ihrdjl5xycr38m4jq40r2lzmpmkmqym"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((install (assoc-ref %standard-phases 'install)))
+ (with-directory-excursion "OTC"
+ (install #:outputs `(("out" . ,#$output))))
+ (with-directory-excursion "OTF"
+ (install #:outputs `(("out" . ,#$output:otf))))))))))
+ (outputs '("out" "otf"))
(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
H
H
Hilton Chain wrote on 28 Feb 04:08 +0100
[PATCH v2 5/5] gnu: font-google-noto-serif-cjk: Update to 2.002.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
37d4c99859fa0cd8b6d1802ea1181fcec8e100db.1709089250.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-serif-cjk): Update to 2.002.
[source]: Switch to variable fonts.
[arguments]<#:phases>: Keep only TTCs in "out".
Install OTFs into "otf" output.
[outputs]: Add "otf".

Change-Id: Id22401ce85028951b6044ba418dbad764d581f01
---
gnu/packages/fonts.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 356103c6a1..02c299cdd4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1213,17 +1213,28 @@ (define-public font-google-noto-sans-cjk
(define-public font-google-noto-serif-cjk
(package
(name "font-google-noto-serif-cjk")
- (version "2.001")
+ (version "2.002")
(source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Serif"
- version "/04_NotoSerifCJKOTC.zip"))
+ version "/02_NotoSerifCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1l6r3sz2s0vcyfx6ria7wqcq45zp40gxgg97lh8hpmajhzw301ig"))))
+ (base32 "007jk7rmfapq5zq4ji9d1l5gpp34p98l9ylhiw33q42d66v2g717"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((install (assoc-ref %standard-phases 'install)))
+ (with-directory-excursion "OTC"
+ (install #:outputs `(("out" . ,#$output))))
+ (with-directory-excursion "OTF"
+ (install #:outputs `(("out" . ,#$output:otf))))))))))
+ (outputs '("out" "otf"))
(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
H
H
Hilton Chain wrote on 28 Feb 14:31 +0100
[PATCH v3 0/5] Update Noto fonts and switch them to variable fonts (77% size reduced).
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
cover.1709126509.git.hako@ultrarare.space
V2 -> V3:
- Fix malformed ‘let’ for font-google-noto-emoji.
- Simplify phases for font-google-noto again.
- Adjust commit messages.

V1 -> V2: Simplify phases and add extra outputs.

Hilton Chain (5):
gnu: font-google-noto: Update to 24.2.1.
gnu: font-google-noto: Prefer variable fonts and split outputs.
gnu: font-google-noto-emoji: Update to 2.042.
gnu: font-google-noto-sans-cjk: Switch to variable fonts.
gnu: font-google-noto-serif-cjk: Update to 2.002.

gnu/packages/fonts.scm | 94 +++++++++++++++++++++++++++++++++++-------
1 file changed, 80 insertions(+), 14 deletions(-)


base-commit: 8c0282cf543fe205a5b89201cd7bb8889121a07c
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 14:32 +0100
[PATCH v3 4/5] gnu: font-google-noto-sans-cjk: Switch to variable fonts.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
3f1bd566a3e844a620543a010915b4d298fbd08f.1709126510.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-sans-cjk)
[source]: Switch to variable fonts.
[outputs]: Add "otf".
[arguments]<#:phases>: Install OTFs into it.
Keep TTCs in "out".

Change-Id: I996d75b7892333bc69d21af53a5243a442e3a6b3
---
gnu/packages/fonts.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index e1e1127ab5..42ebda3ef4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1187,11 +1187,22 @@ (define-public font-google-noto-sans-cjk
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Sans"
- version "/03_NotoSansCJK-OTC.zip"))
+ version "/01_NotoSansCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1v9yda7r98g4a3pk0y3cjbgc1i2lv4ax0f0v6aqasfzz4ldlx3sj"))))
+ (base32 "1ka37kqyd0sfqwk485nv6ihrdjl5xycr38m4jq40r2lzmpmkmqym"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((install (assoc-ref %standard-phases 'install)))
+ (with-directory-excursion "OTC"
+ (install #:outputs `(("out" . ,#$output))))
+ (with-directory-excursion "OTF"
+ (install #:outputs `(("out" . ,#$output:otf))))))))))
+ (outputs '("out" "otf"))
(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
H
H
Hilton Chain wrote on 28 Feb 14:32 +0100
[PATCH v3 5/5] gnu: font-google-noto-serif-cjk: Update to 2.002.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
f63e275069e198347f28aa3ec2d6c51611e639be.1709126510.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-serif-cjk): Update to 2.002.
[source]: Switch to variable fonts.
[outputs]: Add "otf".
[arguments]<#:phases>: Install OTFs into it.
Keep TTCs in "out".

Change-Id: Id22401ce85028951b6044ba418dbad764d581f01
---
gnu/packages/fonts.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 42ebda3ef4..cdd6e80655 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1214,17 +1214,28 @@ (define-public font-google-noto-sans-cjk
(define-public font-google-noto-serif-cjk
(package
(name "font-google-noto-serif-cjk")
- (version "2.001")
+ (version "2.002")
(source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/googlefonts/noto-cjk/releases/download/Serif"
- version "/04_NotoSerifCJKOTC.zip"))
+ version "/02_NotoSerifCJK-OTF-VF.zip"))
(file-name (string-append name "-" version ".zip"))
(sha256
- (base32 "1l6r3sz2s0vcyfx6ria7wqcq45zp40gxgg97lh8hpmajhzw301ig"))))
+ (base32 "007jk7rmfapq5zq4ji9d1l5gpp34p98l9ylhiw33q42d66v2g717"))))
(build-system font-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'install
+ (lambda _
+ (let ((install (assoc-ref %standard-phases 'install)))
+ (with-directory-excursion "OTC"
+ (install #:outputs `(("out" . ,#$output))))
+ (with-directory-excursion "OTF"
+ (install #:outputs `(("out" . ,#$output:otf))))))))))
+ (outputs '("out" "otf"))
(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
H
H
Hilton Chain wrote on 28 Feb 14:32 +0100
[PATCH v3 1/5] gnu: font-google-noto: Update to 24.2.1.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
f8184e40c68c783c4f93d4903b8f509c6897378c.1709126509.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto): Update to 24.2.1.

Change-Id: I238f914388a2d808b817de1252ba8ee84c6299bd
---
gnu/packages/fonts.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 2cc420f7ba..72bf0124c4 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1081,7 +1081,7 @@ (define-public font-gnu-unifont
(define-public font-google-noto
(package
(name "font-google-noto")
- (version "23.11.1")
+ (version "24.2.1")
(source
(origin
(method git-fetch)
@@ -1090,7 +1090,7 @@ (define-public font-google-noto
(commit (string-append "noto-monthly-release-" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0vvxhky35l4i0ha60yw0gj26f3v33hpf2zax17yyj16mww4cn4d8"))))
+ (base32 "087jg8ahpq35xwyrmvm9ivxl0wjic2j4r28bbrwqmgdva9brms40"))))
(build-system font-build-system)
(home-page "https://www.google.com/get/noto/")
(synopsis "Fonts to cover all languages")
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 14:32 +0100
[PATCH v3 3/5] gnu: font-google-noto-emoji: Update to 2.042.
(address . 69424@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
c77413831b4a8b359e8d08d7fbba28217abe10d6.1709126510.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto-emoji): Update to 2.042.
[arguments]<#:phases>: Remove 'remove-unsupported.
Install only "NotoColorEmoji.ttf".

Change-Id: I76cfbf3f8d34c484ed59b99969da7d93aaf41d72
---
gnu/packages/fonts.scm | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 4f9400047f..e1e1127ab5 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1147,7 +1147,7 @@ (define-public font-google-noto
(define-public font-google-noto-emoji
(package
(name "font-google-noto-emoji")
- (version "2.038")
+ (version "2.042")
(source
(origin
(method git-fetch)
@@ -1157,7 +1157,7 @@ (define-public font-google-noto-emoji
(file-name (git-file-name name version))
(sha256
(base32
- "1rgmcc6nqq805iqr8kvxxlk5cf50q714xaxk3ld6rjrd69kb8ix9"))))
+ "17i7awyqz9jv0j2blcf0smmpas375c3pdhjv1zqzl861g8qm1lm2"))))
(build-system font-build-system)
(arguments
(list
@@ -1167,11 +1167,10 @@ (define-public font-google-noto-emoji
(lambda _
;; Note this ensures the correct license file is installed.
(chdir "fonts")))
- (add-after 'enter-font-directory 'remove-unsupported
- (lambda* _
- (delete-file "NotoColorEmoji_WindowsCompatible.ttf")
- (delete-file "Noto-COLRv1-noflags.ttf")
- (delete-file "Noto-COLRv1.ttf"))))))
+ (replace 'install
+ (lambda _
+ (let ((dir (string-append #$output "/share/fonts/truetype")))
+ (install-file "NotoColorEmoji.ttf" dir)))))))
(home-page "https://fonts.google.com/noto/specimen/Noto+Color+Emoji")
(synopsis "Font for rendering color emoji characters")
(description
--
2.41.0
H
H
Hilton Chain wrote on 28 Feb 14:32 +0100
[PATCH v3 2/5] gnu: font-google-noto: Prefer variable fonts and split outputs.
(address . 69424@debbugs.gnu.org)
5eada4da5298fdaba9d6a05b411161637b3a42a4.1709126510.git.hako@ultrarare.space
* gnu/packages/fonts.scm (font-google-noto)[outputs]: Add "ttf".
[arguments]<#:phase>: Move hinted TTFs into it.
Prefer variable fonts.

Suggested-by: Jiwei YANG <yangjiwei@protonmail.com>
Change-Id: Icac2927fb6c35d08504c379e273a5fc03b08ac46
---
gnu/packages/fonts.scm | 45 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (58 lines)
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
J
J
Jiwei YANG wrote on 28 Feb 13:19 +0100
(No Subject)
(name . 69424@debbugs.gnu.org)(address . 69424@debbugs.gnu.org)
rJWYp2XzXaMzdkaCNvkLt8Ym62SYVBhYB3qri1Lh9vv5d9Gog8lSF9lN1Bnvn9zsB_1Uz_T1txEcSU8H4v9PjAbujqgF9HmI-VhQ4xXqbr4=@protonmail.com
Thanks! For font-google-noto-sans-cjk and font-google-noto-serif-cjk, will it be good to use "Super OTC" fonts? In my case, LibreOffice (flatpak version) was unable to recognize "Super OTC" edition but it is fixed now. There may still be some compatibility problems that I have not noticed.
Attachment: file
Attachment: signature.asc
H
H
Hilton Chain wrote on 29 Feb 06:16 +0100
(name . Jiwei YANG)(address . yangjiwei@protonmail.com)(address . 69424@debbugs.gnu.org)
87frxb26kr.wl-hako@ultrarare.space
Hi!

On Wed, 28 Feb 2024 20:19:41 +0800,
Jiwei YANG via Guix-patches via wrote:
Toggle quote (6 lines)
>
> Thanks! For font-google-noto-sans-cjk and font-google-noto-serif-cjk, will it
> be good to use "Super OTC" fonts? In my case, LibreOffice (flatpak version)
> was unable to recognize "Super OTC" edition but it is fixed now. There may
> still be some compatibility problems that I have not noticed.

Since in this series I'm switching to variable fonts, the (static) "Super OTC"
format has no advantage in either feature or size.


Thanks
H
H
Hilton Chain wrote on 17 Mar 02:09 +0100
Re: [bug#69424] [PATCH 0/5] Update Noto fonts and switch them to variable fonts (77% size reduced).
(address . 69424-done@debbugs.gnu.org)
87sf0pll4y.wl-hako@ultrarare.space
Applied the series as 17b1350f68d5...b6835ef46224, closing.
Closed
?