From 9d600fef4f18a985c97be51a31ecd0b52bd7f148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Fri, 27 Feb 2015 13:59:29 +0800 Subject: [PATCH] gnu: Add font-adobe-source-han-sans. * gnu/packages/fonts.scm (font-adobe-source-han-sans): New variable. --- gnu/packages/fonts.scm | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm index 94993f0..2fa88eb 100644 --- a/gnu/packages/fonts.scm +++ b/gnu/packages/fonts.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Joshua Grant ;;; Copyright © 2014 Alex Kost +;;; Copyright © 2015 Sou Bunnbu ;;; ;;; This file is part of GNU Guix. ;;; @@ -303,3 +304,59 @@ The Liberation Fonts are sponsored by Red Hat.") (description "Terminus Font is a clean, fixed width bitmap font, designed for long (8 and more hours per day) work with computers.") (license license:silofl1.1))) + +(define-public font-adobe-source-han-sans + (package + (name "font-adobe-source-han-sans") + (version "1.001R") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/adobe-fonts/source-han-sans/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0cwz3d8jancl0a7vbjxhnh1vgwsjba62lahfjya9yrjkp1ndxlap")))) + (outputs '("out" "cn" "jp" "kr" "tw")) + (build-system gnu-build-system) + (arguments + '(#:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:imported-modules ((guix build gnu-build-system) + (guix build utils)) + #:phases + (alist-replace + 'install + (lambda* (#:key outputs #:allow-other-keys) + (define (install-opentype-font font out) + (let* ((font-dir (string-append out "/share/fonts/opentype")) + (newfont (string-append font-dir "/" (basename font)))) + (mkdir-p font-dir) + (copy-file font newfont))) + ;; Install OpenType/CFF collection (OTC). + (for-each (cut install-opentype-font <> (assoc-ref outputs "out")) + (find-files "OTC" "\\.ttc")) + ;; Install region-specific subset OpenType/CFF (Subset OTF). + (for-each (cut install-opentype-font <> (assoc-ref outputs "cn")) + (find-files "SubsetOTF/CN" "\\.otf")) + (for-each (cut install-opentype-font <> (assoc-ref outputs "jp")) + (find-files "SubsetOTF/JP" "\\.otf")) + (for-each (cut install-opentype-font <> (assoc-ref outputs "kr")) + (find-files "SubsetOTF/KR" "\\.otf")) + (for-each (cut install-opentype-font <> (assoc-ref outputs "tw")) + (find-files "SubsetOTF/TW" "\\.otf"))) + (map (cut assq <> %standard-phases) + '(set-paths unpack install))))) + (home-page "https://github.com/adobe-fonts/source-han-sans") + (synopsis "Pan-CJK fonts") + (description + "Source Han Sans is a sans serif Pan-CJK font family that is offered in +seven weights: ExtraLight, Light, Normal, Regular, Medium, Bold, and Heavy. +And in several OpenType/CFF-based deployment configurations to accommodate +various system requirements or limitations. As the name suggests, Pan-CJK +fonts are intended to support the characters necessary to render or display +text in Simplified Chinese, Traditional Chinese, Japanese, and Korean. +") + (license license:asl2.0))) -- 2.1.4