Patchwork Add PT Astra font.

login
register
mail settings
Submitter Dmitry Nikolaev
Date Oct. 5, 2016, 9:06 p.m.
Message ID <CAH3JXcFoqVV1uUVmnG3nKDnJ5n9qpHn2rE8nG5H059LEpd_4sA@mail.gmail.com>
Download mbox | patch
Permalink /patch/16285/
State New
Headers show

Comments

Dmitry Nikolaev - Oct. 5, 2016, 9:06 p.m.
Hi. PT Astra is a free font metric compatible with proprietary Times New
Roman.

Dmitry Nikolaev
Rastus Vernon - Oct. 6, 2016, 2:37 a.m.
On Thu, 2016-10-06 at 00:06 +0300, Dmitry Nikolaev wrote:
> Hi. PT Astra is a free font metric compatible with proprietary Times
> New
> Roman.
> 
> Dmitry Nikolaev

According to the font file, the version is 1.001, not 1001.
Hartmut Goebel - Oct. 6, 2016, 9:06 a.m.
Am 05.10.2016 um 23:06 schrieb Dmitry Nikolaev:
> +    (synopsis "A typeface metric compatible with Times New Roman.")

AFAIK the synopsis should not start with an "A". Please verify be running

guix lint font-pt-astra
Adonay Felipe Nogueira - Oct. 7, 2016, 10:06 p.m.
A minor fix would be: Instead of forcing the source file name to a fixed
string, make it more dynamic but still consistent, like so:

(file-name name "-" version ".zip")

Patch

From 1e037b8dbb4c2249849922dceb637ee58ad33c65 Mon Sep 17 00:00:00 2001
From: 8p8c <cameltheman@gmail.com>
Date: Thu, 6 Oct 2016 00:02:58 +0300
Subject: [PATCH] Add PT Astra font.

---
 gnu/packages/fonts.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index fe6c227..9482d7a 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -865,3 +865,46 @@  powerline support.")
     (license (license:x11-style
               "https://github.com/chrissimpkins/Hack/blob/master/LICENSE.md"
               "Hack Open Font License v2.0"))))
+
+(define-public font-pt-astra
+  (package
+    (name "font-pt-astra")
+    (version "1001")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://astralinux.com/images/fonts/PTAstraSan&Serif_TTF_ver"
+                    version
+                    ".zip"))
+              (sha256
+               (base32
+                "11aaj3wq0z8f4w52axdb7ca44l7zm72cx7a1w11qvyl71bzl28ms"))
+              (file-name "font-pt-astra.zip")))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder (begin
+                   (use-modules (guix build utils)
+                                (srfi srfi-26))
+
+                   (let ((PATH     (string-append (assoc-ref %build-inputs
+                                                             "unzip")
+                                                  "/bin"))
+                         (font-dir (string-append %output
+                                                  "/share/fonts/truetype")))
+                     (setenv "PATH" PATH)
+                     (system* "unzip" (assoc-ref %build-inputs "source"))
+
+                     (mkdir-p font-dir)
+                     (for-each (lambda (ttf)
+                                 (copy-file ttf
+                                            (string-append font-dir "/" ttf)))
+                               (find-files "." "\\.ttf$"))))))
+    (native-inputs
+     `(("source" ,source)
+       ("unzip" ,unzip)))
+    (home-page "https://astralinux.com/fonts.html")
+    (synopsis "A typeface metric compatible with Times New Roman.")
+    (description "PT Astra is a free typeface which is metric
+compatible with proprietary Times New Roman.")
+    (license license:silofl1.1)))
-- 
2.10.0