unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27107: [PATCH] gnu: font-comic-neue: Add fontconfig alias.
@ 2017-05-27 18:54 Alex Griffin
  2017-05-28 16:38 ` Arun Isaac
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Alex Griffin @ 2017-05-27 18:54 UTC (permalink / raw)
  To: 27107

[-- Attachment #1: Type: text/plain, Size: 235 bytes --]

This patch adds a fontconfig alias to the Comic Neue patch, which must
be manually enabled (with a symlink in your fontconfig directory). If
Comic Sans is missing from the system, it displays using Comic Neue
instead.
-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-font-comic-neue-Add-fontconfig-alias.patch --]
[-- Type: text/x-patch; name="0001-gnu-font-comic-neue-Add-fontconfig-alias.patch", Size: 4496 bytes --]

From 7f672ee40566990448ecbec49eae8892dd7729a3 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 27 May 2017 11:43:18 -0500
Subject: [PATCH 3/4] gnu: font-comic-neue: Add fontconfig alias.

* gnu/packages/fonts.scm (font-comic-neue): Re-indent.
[arguments]: Add fontconfig alias for Comic Sans.  Remove unnecessary
call to string-append.
---
 gnu/packages/fonts.scm | 80 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 48 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 21054e53a..02ab4ad4b 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -1261,39 +1261,55 @@ later hand-tweaked with the gbdfed(1) editor:
 
 (define-public font-comic-neue
   (package
-   (name "font-comic-neue")
-   (version "2.3")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append
-                  "http://www.comicneue.com/comic-neue-" version ".zip"))
-            (sha256
-             (base32
-              "1695hkpd8kqnr2a88p8xs496slgzxjjkzpa9aa33ml3pnh7519zk"))))
-   (build-system trivial-build-system)
-   (arguments
-    `(#:modules ((guix build utils))
-      #:builder (begin
-                  (use-modules (guix build utils))
-                  (let ((font-dir (string-append %output
-                                                 "/share/fonts/truetype"))
-                        (source (assoc-ref %build-inputs "source"))
-                        (unzip  (string-append (assoc-ref %build-inputs "unzip")
-                                               "/bin/unzip")))
-                    (mkdir-p font-dir)
-                    (system* unzip source)
-                    (with-directory-excursion
-                     (string-append "Web")
-                     (for-each (lambda (ttf)
-                                 (install-file ttf font-dir))
-                               (find-files "." "\\.ttf$")))))))
-   (native-inputs `(("unzip" ,unzip)))
-   (home-page "http://www.comicneue.com/")
-   (synopsis "Font that fixes the shortcomings of Comic Sans")
-   (description
-    "Comic Neue is a font that attempts to create a respectable casual
+    (name "font-comic-neue")
+    (version "2.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://www.comicneue.com/comic-neue-" version ".zip"))
+              (sha256
+               (base32
+                "1695hkpd8kqnr2a88p8xs496slgzxjjkzpa9aa33ml3pnh7519zk"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder (begin
+                   (use-modules (guix build utils))
+                   (let ((font-dir (string-append %output
+                                                  "/share/fonts/truetype"))
+                         (conf-dir (string-append %output
+                                                  "/share/fontconfig/conf.avail"))
+                         (source (assoc-ref %build-inputs "source"))
+                         (unzip  (string-append (assoc-ref %build-inputs "unzip")
+                                                "/bin/unzip")))
+                     (mkdir-p font-dir)
+                     (system* unzip source)
+                     (with-directory-excursion "Web"
+                       (for-each (lambda (ttf)
+                                   (install-file ttf font-dir))
+                                 (find-files "." "\\.ttf$")))
+                     (mkdir-p conf-dir)
+                     (call-with-output-file
+                         (string-append conf-dir "/30-comic-neue.conf")
+                       (lambda (port)
+                         (format port "<?xml version=\"1.0\"?>
+<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
+<fontconfig>
+  <!-- If Comic Sans is missing, use Comic Neue instead. -->
+  <alias>
+    <family>Comic Sans MS</family>
+    <prefer>
+      <family>Comic Neue</family>
+    </prefer>
+  </alias>
+</fontconfig>\n")))))))
+    (native-inputs `(("unzip" ,unzip)))
+    (home-page "http://www.comicneue.com/")
+    (synopsis "Font that fixes the shortcomings of Comic Sans")
+    (description
+     "Comic Neue is a font that attempts to create a respectable casual
 typeface, by mimicking Comic Sans while fixing its most obvious shortcomings.")
-   (license license:silofl1.1)))
+    (license license:silofl1.1)))
 
 (define-public font-iosevka
   (package
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-06-01 18:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-27 18:54 bug#27107: [PATCH] gnu: font-comic-neue: Add fontconfig alias Alex Griffin
2017-05-28 16:38 ` Arun Isaac
     [not found] ` <971c125f.ADsAAg_HJlUAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZKv0R@mailjet.com>
2017-05-31 17:01   ` Alex Griffin
2017-06-01 13:50     ` Arun Isaac
     [not found]     ` <c757126b.AEEALPlfx1UAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMBvE@mailjet.com>
2017-06-01 14:03       ` Alex Griffin
2017-06-01 15:12         ` Arun Isaac
     [not found]         ` <ed110519.AEUAKvsBN2MAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMC7e@mailjet.com>
2017-06-01 15:34           ` Alex Griffin
2017-06-01 15:48             ` Alex Griffin
2017-06-01 16:01               ` Arun Isaac
2017-06-01 16:50               ` Arun Isaac
     [not found]               ` <59879525.AEMAK8sFRAAAAAAAAAAAAAPFkxsAAAACwQwAAAAAAAW9WABZMEXM@mailjet.com>
2017-06-01 18:11                 ` Alex Griffin
2017-06-01 18:46                   ` Arun Isaac
2017-05-31 19:56 ` Alex Griffin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).