diff mbox series

[bug#38157] gnu: Add font-dseg.

Message ID e4ddaaeafdff4c82afb9d8243dd40a785cd15f7e.camel@zrythm.org
State Accepted
Headers show
Series [bug#38157] gnu: Add font-dseg. | expand

Commit Message

Alexandros Theodotou Nov. 10, 2019, 6:11 p.m. UTC
Hi Tobias,

> You could
> 
>     (apply string-append (string-split version #\.))
> or
> 
>     (string-join (string-split version #\.) "")
> 
> I think I prefer the STRING-APPEND version but both are fine.

Thank you for the pointer! Patch updated.

Just a general note that there are some additional WOFF fonts in the
zip, but I think those are only relevant for websites so I am only
installing the truetype fonts. 

I also tested and verified that Zrythm can now find the font.
diff mbox series

Patch

From ec6c88abe3de6346087d821539e43afb3dff42c8 Mon Sep 17 00:00:00 2001
From: Alexandros Theodotou <alex@zrythm.org>
Date: Sun, 10 Nov 2019 01:25:28 +0000
Subject: [PATCH] gnu: Add font-dseg.

* gnu/packages/fonts.scm (font-dseg): New variable.
---
 gnu/packages/fonts.scm | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index bb6dc45d94..7fe0aee20b 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -27,6 +27,7 @@ 
 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2019 Baptiste Strazzulla <bstrazzull@hotmail.fr>
 ;;; Copyright © 2019 Alva <alva@skogen.is>
+;;; Copyright © 2019 Alexandros Theodotou <alex@zrythm.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1524,3 +1525,42 @@  Symbols stand out from common text.  Dots and commas are easily seen, and
 operators are clear even when not surrounded by spaces.  Similar characters
 have been designed to be very distinguishable from each other.")
     (license license:silofl1.1)))
+
+(define-public font-dseg
+  (package
+    (name "font-dseg")
+    (version "0.45")
+    (source
+      (origin
+        (method url-fetch/zipbomb)
+        (uri
+          (string-append "https://github.com/keshikan/DSEG/"
+                         "releases/download/v" version
+                         "/fonts-DSEG_v"
+                         (apply string-append (string-split version #\.))
+                         ".zip"))
+        (sha256
+          (base32
+            "0v8sghh4vl286faf8pvi74znz07pyf0qii8z4wjllisqwc35sx72"))))
+    (build-system font-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (font-dir (string-append out "/share/fonts"))
+                    (truetype-dir (string-append font-dir "/truetype")))
+               (with-directory-excursion
+                 (string-append "fonts-DSEG_v"
+                                (apply string-append (string-split ,version
+                                                                   #\.)))
+                 (for-each (lambda (f) (install-file f truetype-dir))
+                           (find-files "." "\\.ttf$"))
+               #t)))))))
+    (home-page "https://www.keshikan.net/fonts-e.html")
+    (synopsis "DSEG: 7-segment and 14-segment fonts")
+    (description
+     "DSEG is a font family that imitates seven and fourteen segment
+display (7SEG,14SEG). DSEG includes the roman alphabet and symbol glyphs.")
+    (license license:silofl1.1)))
-- 
2.24.0