gnu: emacspeak: Fix Tclx and espeak server loading.
[jackhill/guix/guix.git] / gnu / packages / fontutils.scm
index d78811b..c02be64 100644 (file)
@@ -2,16 +2,16 @@
 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2017 ng0 <ng0@n0.is>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017 Nikita <nikita@n0.is>
+;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages fontutils)
   #:use-module (gnu packages)
-  #:use-module (gnu packages compression)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
+  #:use-module (gnu packages build-tools)   ;for meson-0.55
   #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages datastructures)
+  #:use-module (gnu packages flex)
+  #:use-module (gnu packages fonts)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages fribidi)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gperf)
+  #:use-module (gnu packages gtk)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages man)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages autotools)
-  #:use-module (gnu packages gettext)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
-  #:use-module (gnu packages image)
-  #:use-module (gnu packages bison)
-  #:use-module (gnu packages flex)
-  #:use-module (gnu packages glib)
-  #:use-module (gnu packages gperf)
-  #:use-module (gnu packages xorg)
-  #:use-module (gnu packages fribidi)
-  #:use-module (gnu packages gtk)
-  #:use-module (gnu packages xml)
   #:use-module (gnu packages sqlite)
-  #:use-module (gnu packages gnome)
-  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages webkit)
+  #:use-module (gnu packages xdisorg)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
 (define-public freetype
   (package
    (name "freetype")
-   (version "2.10.1")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append "mirror://savannah/freetype/freetype-"
-                                version ".tar.xz"))
-            (sha256 (base32
-                     "0vx2dg1jh5kq34dd6ifpjywkpapp8a7p1bvyq9yq5zi1i94gmnqn"))))
+   (version "2.10.4")
+   (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "mirror://savannah/freetype/freetype-"
+                          version ".tar.xz"))
+      (sha256
+       (base32 "112pyy215chg7f7fmp2l9374chhhpihbh8wgpj5nj6avj3c59a46"))))
    (build-system gnu-build-system)
    (arguments
     ;; The use of "freetype-config" is deprecated, but other packages still
@@ -99,7 +107,7 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
 (define-public ttfautohint
   (package
     (name "ttfautohint")
-    (version "1.5")
+    (version "1.8.3")
     (source
      (origin
        (method url-fetch)
@@ -107,8 +115,7 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4"))
-       (patches (list (search-patch "ttfautohint-source-date-epoch.patch")))))
+         "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("flex" ,flex)
@@ -118,7 +125,8 @@ anti-aliased glyph bitmap generation with 256 gray levels.")
      `(("freetype" ,freetype)
        ("harfbuzz" ,harfbuzz)))
     (arguments
-     `(#:configure-flags '("--with-qt=no"))) ;no gui
+     `(#:configure-flags '("--disable-static"
+                           "--with-qt=no"))) ;no gui
     (synopsis "Automated font hinting")
     (description
      "ttfautohint provides a 99% automated hinting process and a platform for
@@ -145,7 +153,7 @@ scripts.")
     (inputs
      `(("zlib" ,zlib)))
     (arguments
-     `(#:make-flags '("CC=gcc")
+     `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
        #:tests? #f                      ;no tests
        #:phases
        (modify-phases %standard-phases
@@ -155,7 +163,8 @@ scripts.")
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin")))
                (install-file "sfnt2woff" bin)
-               (install-file "woff2sfnt" bin)))))))
+               (install-file "woff2sfnt" bin))
+             #t)))))
     (synopsis "Convert between OpenType and WOFF fonts")
     (description
      "This package provides two tools:
@@ -176,7 +185,7 @@ Converts WOFF fonts to OpenType fonts
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://github.com/wget/ttf2eot.git")
+             (url "https://github.com/wget/ttf2eot")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
@@ -262,32 +271,50 @@ work with most software requiring Type 1 fonts.")
   (package
     (name "woff2")
     (version "1.0.2")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/google/woff2.git")
-                    (commit (string-append "v" version))))
-              (file-name (string-append name "-" version ".git"))
-              (sha256
-               (base32
-                "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/google/woff2")
+         (commit (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
     (build-system cmake-build-system)
+    (outputs '("out" "bin"))
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        (string-append "-DCMAKE_INSTALL_BINDIR="
+                       (assoc-ref %outputs "bin")
+                       "/bin")
+        (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
+                       (assoc-ref %outputs "out")
+                       "/include")
+        (string-append "-DCMAKE_INSTALL_LIBDIR="
+                       (assoc-ref %outputs "out")
+                       "/lib"))
+       #:phases
+       (modify-phases %standard-phases
+         ;; To install both binaries and libraries.
+         (add-after 'unpack 'patch-installation
+           (lambda _
+             (substitute* "CMakeLists.txt"
+               (("NOT BUILD_SHARED_LIBS")
+                "BUILD_SHARED_LIBS"))
+             #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("google-brotli" ,google-brotli)))
-    (arguments
-     ;; package has no tests
-     `(#:tests? #f
-       ;; we can’t have both, shared libraries and binaries, so turn off the
-       ;; former
-       #:configure-flags (list "-DBUILD_SHARED_LIBS=OFF")))
-    (synopsis "Compress TrueType fonts to WOFF2")
-    (description
-     "This package provides utilities for compressing/decompressing TrueType
-fonts to/from the WOFF2 format.")
-    (license license:asl2.0)
-    (home-page "https://github.com/google/woff2")))
+     `(("brotli" ,google-brotli)))
+    (synopsis "Libraries and tools for WOFF2 font format")
+    (description "WOFF2 provides libraries and tools to handle the Web Open
+Font Format (WOFF).")
+    (home-page "https://w3c.github.io/woff/woff2/")
+    (license license:expat)))
 
 (define-public fontconfig
   (package
@@ -306,16 +333,19 @@ fonts to/from the WOFF2 format.")
    (propagated-inputs `(("expat" ,expat)
                         ("freetype" ,freetype)
                         ("libuuid" ,util-linux "lib")))
-   (inputs `(("gs-fonts" ,gs-fonts)))
+   (inputs
+    ;; We use to use 'gs-fonts' but they are not recognized by newer versions
+    ;; of Pango, causing many applications to fail to find fonts otherwise.
+    `(("font-dejavu" ,font-dejavu)))
    (native-inputs
     `(("gperf" ,gperf)
       ("pkg-config" ,pkg-config)))
    (arguments
     `(#:configure-flags
       (list "--with-cache-dir=/var/cache/fontconfig"
-            ;; register gs-fonts as default fonts
+            ;; register the default fonts
             (string-append "--with-default-fonts="
-                           (assoc-ref %build-inputs "gs-fonts")
+                           (assoc-ref %build-inputs "font-dejavu")
                            "/share/fonts")
 
             ;; Register fonts from user and system profiles.
@@ -427,7 +457,7 @@ primary means by which end users perform conversions, and they have not
 been designed, tested, and debugged to the extent that general-purpose
 applications should be.")
     (license license:lgpl2.1+)
-    (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
+    (home-page "https://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
 
 (define-public graphite2
   (package
@@ -523,15 +553,15 @@ using the above tables.")
 (define-public libspiro
   (package
     (name "libspiro")
-    (version "20190731")
+    (version "20200505")
     (source
      (origin
       (method url-fetch)
       (uri (string-append "https://github.com/fontforge/libspiro/releases"
-                          "/download/" version "/libspiro-" version ".tar.gz"))
+                          "/download/" version "/libspiro-dist-" version ".tar.gz"))
       (sha256
        (base32
-        "0m63x97b7aciviijprvy85gm03p2jsgslxn323zl9zn7qz6d3ir4"))))
+        "0j8fmyj4wz6mqk17dqs6f8jx0i52n68gv5px17qbrjnbilg9mih6"))))
     (build-system gnu-build-system)
     (arguments
      '(#:configure-flags '("--disable-static")))
@@ -732,14 +762,14 @@ implements UFO3 as described by the UFO font format.")
     (version "20170925")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/googlei18n/nototools/"
-                           "archive/v2017-09-25-tooling-for-phase3-"
-                           "update.tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/googlei18n/nototools")
+              (commit "v2017-09-25-tooling-for-phase3-update")))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "1pvacw18cm9l4sb66pqyjc7hc74xhhfxc7kd5ald8lixf4wzg0s8"))))
+         "03nzvcvwmrhfrcjhg218q2f3hfrm3vlivp4rk19sc397kh3hisiz"))))
     (build-system python-build-system)
     (arguments
      `(#:python ,python-2))
@@ -767,10 +797,54 @@ maintain the Noto Fonts project.")
                     "file://sample_texts/attributions.txt"
                     "See sample_texts/attributions.txt in the distribution.")))))
 
+(define-public fcft
+  (package
+    (name "fcft")
+    (version "2.3.3")
+    (home-page "https://codeberg.org/dnkl/fcft")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference (url home-page) (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0314r038jl17hrhc9nrbx30jk0pz8ckbdnizws4r46b1rf4h0b1f"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:meson ,meson-0.55))
+    (native-inputs
+     `(("check" ,check)
+       ("gcc" ,gcc-10)    ;TODO: Remove when the default compiler is > GCC 7.
+       ("pkg-config" ,pkg-config)
+       ("scdoc" ,scdoc)))
+    (propagated-inputs
+     `(;; Required by fcft.pc.
+       ("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("harfbuzz" ,harfbuzz)
+       ("pixman" ,pixman)
+       ("tllist" ,tllist)))
+    (synopsis "Font loading and glyph rasterization library")
+    (description
+     "@code{fcft} is a small font loading and glyph rasterization library
+built on-top of FontConfig, FreeType2 and pixman.
+
+It can load and cache fonts from a fontconfig-formatted name string, e.g.
+@code{Monospace:size=12}, optionally with user configured fallback fonts.
+
+After a font has been loaded, you can rasterize glyphs.  When doing so, the
+primary font is first considered.  If it does not have the requested glyph,
+the user configured fallback fonts (if any) are considered.  If none of the
+user configured fallback fonts has the requested glyph, the FontConfig
+generated list of fallback fonts are checked.")
+    ;; The code is distributed under the Expat license, but embeds Unicode
+    ;; data files carrying the Unicode license.
+    (license (list license:expat license:unicode))))
+
 (define-public fontmanager
   (package
    (name "fontmanager")
-   (version "0.7.5")
+   (version "0.8.4")
    (source
     (origin
       (method git-fetch)
@@ -780,7 +854,7 @@ maintain the Noto Fonts project.")
       (file-name (git-file-name name version))
       (sha256
        (base32
-        "16hma8rrkam6ngn5vbdaryn31vdixvii6920g9z928gylz9xkd3g"))))
+        "09rv0srpj8ann2n1zpv1frlpxz0x10d2y21c5lys7pmfngljlxi9"))))
    (build-system meson-build-system)
    (arguments
     `(#:glib-or-gtk? #t
@@ -790,19 +864,21 @@ maintain the Noto Fonts project.")
                            (assoc-ref %outputs "out")
                            "/lib/font-manager"))))
    (native-inputs
-    `(("pkg-config" ,pkg-config)
-      ("vala" ,vala)
-      ("yelp-tools" ,yelp-tools)
+    `(("desktop-file-utils" ,desktop-file-utils)
       ("gettext" ,gettext-minimal)
       ("glib" ,glib "bin")
       ("gobject-introspection" ,gobject-introspection)
-      ("desktop-file-utils" ,desktop-file-utils)))
+      ("pkg-config" ,pkg-config)
+      ("vala" ,vala-0.50)
+      ("yelp-tools" ,yelp-tools)))
    (inputs
-    `(("json-glib" ,json-glib)
-      ("sqlite" ,sqlite)
-      ("fonconfig" ,fontconfig)
+    `(("fonconfig" ,fontconfig)
       ("freetype" ,freetype)
-      ("gtk+" ,gtk+)))
+      ("gtk+" ,gtk+)
+      ("json-glib" ,json-glib)
+      ("libsoup" ,libsoup)
+      ("sqlite" ,sqlite)
+      ("webkitgtk" ,webkitgtk)))
    (home-page "https://fontmanager.github.io/")
    (synopsis "Simple font management for GTK+ desktop environments")
    (description "Font Manager is intended to provide a way for users to
@@ -817,14 +893,14 @@ work well with other GTK+ desktop environments.")
     (name "fntsample")
     (version "5.3")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/eugmes/fntsample/archive/release/"
-                    version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/eugmes/fntsample")
+                     (commit (string-append "release/" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "0awp4dh1g40ivzvm5xqlvcpcdw1vplrx3drjmbylr62y185vbs74"))))
+                "02rx3gp7k472304vhjwb129nw10a29s4nvgs7i2m6bpjhlk2xgs5"))))
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f ; There are no tests.
@@ -876,7 +952,7 @@ Unicode Charts.  It was developed for use with DejaVu Fonts project.")
 (define-public libraqm
   (package
     (name "libraqm")
-    (version "0.7.0")
+    (version "0.7.1")
     (source
      (origin
        (method url-fetch)
@@ -884,12 +960,12 @@ Unicode Charts.  It was developed for use with DejaVu Fonts project.")
                            "releases/download/v" version "/"
                            "raqm-" version ".tar.gz"))
        (sha256
-        (base32 "0hgry3fj2y3qaq2fnmdgd93ixkk3ns5jds4vglkiv2jfvpn7b1g2"))))
+        (base32 "0a4q9dziirb85sa9rmkamg2krdhd009di2vlz91njwxcp3q8qj46"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags (list "--disable-static")))
     (native-inputs
-     `(("gtk-doc" ,gtk-doc)
+     `(("gtk-doc" ,gtk-doc/stable)
        ("pkg-config" ,pkg-config)
        ("python" ,python-wrapper)))
     (inputs
@@ -906,3 +982,33 @@ It currently provides bidirectional text support (using FriBiDi),
 shaping (using HarfBuzz), and proper script itemization.  As a result, Raqm
 can support most writing systems covered by Unicode.")
     (license license:expat)))
+
+(define-public lcdf-typetools
+  (package
+    (name "lcdf-typetools")
+    (version "2.108")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/kohler/lcdf-typetools")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0a6jqaqwq43ldjjjlnsh6mczs2la9363qav7v9fyrfzkfj8kw9ad"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       ;; This is only provided by the monolithic texlive distribution.
+       ;; FIXME: texlive-kpathsea doesn't come with the library and headers
+       (list "--without-kpathsea")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)))
+    (home-page "https://lcdf.org/type/")
+    (synopsis "Multiple font manipulation tools")
+    (description "LCDF Typetools comprises several programs for manipulating
+PostScript Type 1, Type 1 Multiple Master, OpenType, and TrueType fonts.
+These tools are cfftot1, mmafm, mmpfb, otfinfo, otftotfm, t1dotlessj, t1lint,
+t1rawfm, t1reencode, t1testpage and ttftotype42.")
+    (license license:gpl2+)))