Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / fontutils.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
7 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2017 ng0 <ng0@n0.is>
9 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
11 ;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
12 ;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
13 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31 (define-module (gnu packages fontutils)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-xyz)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages bison)
45 #:use-module (gnu packages flex)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages gperf)
48 #:use-module (gnu packages xorg)
49 #:use-module (gnu packages fribidi)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages sqlite)
53 #:use-module (gnu packages gnome)
54 #:use-module (gnu packages freedesktop)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix packages)
57 #:use-module (guix download)
58 #:use-module (guix svn-download)
59 #:use-module (guix git-download)
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system python)
63 #:use-module (guix build-system meson))
64
65 (define-public freetype
66 (package
67 (name "freetype")
68 (version "2.10.1")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "mirror://savannah/freetype/freetype-"
72 version ".tar.xz"))
73 (sha256 (base32
74 "0vx2dg1jh5kq34dd6ifpjywkpapp8a7p1bvyq9yq5zi1i94gmnqn"))))
75 (build-system gnu-build-system)
76 (arguments
77 ;; The use of "freetype-config" is deprecated, but other packages still
78 ;; depend on it.
79 `(#:configure-flags (list "--enable-freetype-config")))
80 (native-inputs
81 `(("pkg-config" ,pkg-config)))
82 (propagated-inputs
83 ;; These are all in the Requires.private field of freetype2.pc.
84 ;; XXX: add harfbuzz.
85 `(("libpng" ,libpng)
86 ("zlib" ,zlib)))
87 (synopsis "Font rendering library")
88 (description
89 "Freetype is a library that can be used by applications to access the
90 contents of font files. It provides a uniform interface to access font files.
91 It supports both bitmap and scalable formats, including TrueType, OpenType,
92 Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
93 anti-aliased glyph bitmap generation with 256 gray levels.")
94 (license license:freetype) ; some files have other licenses
95 (home-page "https://www.freetype.org/")))
96
97 (define-public ttfautohint
98 (package
99 (name "ttfautohint")
100 (version "1.5")
101 (source
102 (origin
103 (method url-fetch)
104 (uri (string-append "mirror://savannah/freetype/ttfautohint-"
105 version ".tar.gz"))
106 (sha256
107 (base32
108 "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4"))
109 (patches (list (search-patch "ttfautohint-source-date-epoch.patch")))))
110 (build-system gnu-build-system)
111 (native-inputs
112 `(("flex" ,flex)
113 ("bison" ,bison)
114 ("pkg-config" ,pkg-config)))
115 (inputs
116 `(("freetype" ,freetype)
117 ("harfbuzz" ,harfbuzz)))
118 (arguments
119 `(#:configure-flags '("--with-qt=no"))) ;no gui
120 (synopsis "Automated font hinting")
121 (description
122 "ttfautohint provides a 99% automated hinting process and a platform for
123 finely hand-hinting the last 1%. It is ideal for web fonts and supports many
124 scripts.")
125 (license (list license:gpl2+ license:freetype)) ;choose one or the other
126 (home-page "https://www.freetype.org/ttfautohint/")))
127
128 (define-public woff-tools
129 (package
130 (name "woff-tools")
131 (version "2009.10.04")
132 (source
133 (origin
134 (method url-fetch)
135 ;; Upstream source is unversioned, so use Debian's versioned tarball
136 (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
137 "woff-tools_" version ".orig.tar.gz"))
138 (file-name (string-append name "-" version ".tar.gz"))
139 (sha256
140 (base32
141 "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
142 (build-system gnu-build-system)
143 (inputs
144 `(("zlib" ,zlib)))
145 (arguments
146 `(#:make-flags '("CC=gcc")
147 #:tests? #f ;no tests
148 #:phases
149 (modify-phases %standard-phases
150 (delete 'configure) ;no configuration
151 (replace 'install
152 (lambda* (#:key outputs #:allow-other-keys)
153 (let* ((out (assoc-ref outputs "out"))
154 (bin (string-append out "/bin")))
155 (install-file "sfnt2woff" bin)
156 (install-file "woff2sfnt" bin)))))))
157 (synopsis "Convert between OpenType and WOFF fonts")
158 (description
159 "This package provides two tools:
160 @table @code
161 @item sfnt2woff
162 Converts OpenType fonts to WOFF fonts
163 @item woff2sfnt
164 Converts WOFF fonts to OpenType fonts
165 @end table")
166 (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
167 (home-page "https://people.mozilla.com/~jkew/woff/")))
168
169 (define-public ttf2eot
170 (package
171 (name "ttf2eot")
172 (version "0.0.3")
173 (source
174 (origin
175 (method git-fetch)
176 (uri (git-reference
177 (url "https://github.com/wget/ttf2eot.git")
178 (commit (string-append "v" version))))
179 (file-name (git-file-name name version))
180 (sha256
181 (base32
182 "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
183 (patches (list (search-patch "ttf2eot-cstddef.patch")))))
184 (build-system gnu-build-system)
185 (arguments
186 `(#:tests? #f ; no tests
187 #:phases
188 (modify-phases %standard-phases
189 (delete 'configure) ; no configuration
190 (replace 'install ; no install target
191 (lambda* (#:key outputs #:allow-other-keys)
192 (let* ((out (assoc-ref outputs "out"))
193 (bin (string-append out "/bin")))
194 (install-file "ttf2eot" bin)
195 #t))))))
196 (synopsis "Convert from TrueType to Embeddable Open Type")
197 (description
198 "This package contains a commandline wrapper around OpenTypeUtilities.cpp
199 from Chromium, used to make EOT (Embeddable Open Type) files from
200 TTF (TrueType/OpenType Font) files.")
201 ;; While the README states "License: Derived from WebKit, so BSD/LGPL
202 ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
203 ;; license header, and the wrapper source contains no license header.
204 (license license:bsd-2)
205 (home-page "https://github.com/wget/ttf2eot")))
206
207 (define-public ttf2pt1
208 (package
209 (name "ttf2pt1")
210 (version "3.4.4")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "mirror://sourceforge/ttf2pt1/ttf2pt1/"
214 version "/ttf2pt1-" version ".tgz"))
215 (sha256
216 (base32
217 "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf"))
218 (modules '((guix build utils)))
219 (snippet
220 '(begin
221 ;; Remove trailing backslashes in the sed expression of the
222 ;; 'install' rule since sed would otherwise fail.
223 (substitute* "Makefile"
224 (("\\|;\\\\[[:space:]]*$") "|; "))
225 #t))))
226 (build-system gnu-build-system)
227 (arguments
228 '(#:tests? #f ;no tests
229 #:phases (modify-phases %standard-phases
230 (replace 'configure
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let ((out (assoc-ref outputs "out")))
233 (substitute* "Makefile"
234 (("INSTDIR =.*")
235 (string-append "INSTDIR = " out "\n"))
236 (("OWNER = .*")
237 "OWNER = `id -un`\n")
238 (("GROUP = .*")
239 "GROUP = `id -g`\n"))
240 #t)))
241 (replace 'build
242 (lambda _
243 (invoke "make" "-j"
244 (number->string (parallel-job-count))
245 "all" "CC=gcc"))))))
246 (inputs `(("perl" ,perl)))
247 (synopsis "Convert TrueType fonts to Postscript Type 1")
248 (description
249 "TTF2PT1 provides tools to convert most TrueType fonts (or other formats
250 supported by the FreeType library) to an Adobe Type 1 @file{.pfa} or
251 @file{.pfb} file. Another use is as a hinting engine: feed it an unhinted or
252 poorly hinted Adobe Type 1 font through the FreeType library and get it back
253 with freshly generated hints. The files produced by default are in
254 human-readable form, which further needs to be encoded with t1utilities to
255 work with most software requiring Type 1 fonts.")
256 (home-page "http://ttf2pt1.sourceforge.net/")
257 (license license:bsd-3)))
258
259 (define-public woff2
260 (let ((commit "4e698b8c6c5e070d53c340db9ddf160e21070ede")
261 (revision "1"))
262 (package
263 (name "woff2")
264 (version (string-append "20160306-" revision "."
265 (string-take commit 7)))
266 (source (origin
267 (method git-fetch)
268 (uri (git-reference
269 (url "https://github.com/google/woff2.git")
270 (commit commit)))
271 (file-name (string-append name "-" version ".tar.xz"))
272 (sha256
273 (base32
274 "0wka0yhf0cjmd4rv2jckxpyv6lb5ckj4nj0k1ajq5hrjy7f30lcp"))
275 (patches (list (search-patch "woff2-libbrotli.patch")))))
276 (build-system gnu-build-system)
277 (native-inputs
278 `(("pkg-config" ,pkg-config)))
279 (inputs
280 `(("brotli" ,brotli)))
281 (arguments
282 `(#:tests? #f ;no tests
283 #:phases (modify-phases %standard-phases
284 (delete 'configure)
285 (replace 'install
286 (lambda* (#:key outputs #:allow-other-keys)
287 (let* ((out (assoc-ref outputs "out"))
288 (bin (string-append out "/bin")))
289 (install-file "woff2_compress" bin)
290 (install-file "woff2_decompress" bin)
291 #t))))))
292 (synopsis "Compress TrueType fonts to WOFF2")
293 (description
294 "This package provides utilities for compressing/decompressing TrueType
295 fonts to/from the WOFF2 format.")
296 (license license:asl2.0)
297 (home-page "https://github.com/google/woff2"))))
298
299 (define-public fontconfig
300 (package
301 (name "fontconfig")
302 (version "2.13.1")
303 (source (origin
304 (method url-fetch)
305 (uri (string-append
306 "https://www.freedesktop.org/software/fontconfig/release/fontconfig-"
307 version ".tar.bz2"))
308 (sha256 (base32
309 "0hb700a68kk0ip51wdlnjjc682kvlrmb6q920mzajykdk0mdsmgn"))))
310 (build-system gnu-build-system)
311 ;; In Requires or Requires.private of fontconfig.pc.
312 (propagated-inputs `(("expat" ,expat)
313 ("freetype" ,freetype)
314 ("libuuid" ,util-linux)))
315 (inputs `(("gs-fonts" ,gs-fonts)))
316 (native-inputs
317 `(("gperf" ,gperf)
318 ("pkg-config" ,pkg-config)))
319 (arguments
320 `(#:configure-flags
321 (list "--with-cache-dir=/var/cache/fontconfig"
322 ;; register gs-fonts as default fonts
323 (string-append "--with-default-fonts="
324 (assoc-ref %build-inputs "gs-fonts")
325 "/share/fonts")
326
327 ;; Register fonts from user and system profiles.
328 (string-append "--with-add-fonts="
329 "~/.guix-profile/share/fonts,"
330 "/run/current-system/profile/share/fonts")
331
332 ;; python is not actually needed
333 "PYTHON=false")
334 #:phases
335 (modify-phases %standard-phases
336 (replace 'install
337 (lambda _
338 ;; Don't try to create /var/cache/fontconfig.
339 (invoke "make" "install"
340 "fc_cachedir=$(TMPDIR)"
341 "RUN_FC_CACHE_TEST=false"))))))
342 (synopsis "Library for configuring and customizing font access")
343 (description
344 "Fontconfig can discover new fonts when installed automatically;
345 perform font name substitution, so that appropriate alternative fonts can
346 be selected if fonts are missing;
347 identify the set of fonts required to completely cover a set of languages;
348 have GUI configuration tools built as it uses an XML-based configuration file;
349 efficiently and quickly find needed fonts among the set of installed fonts;
350 be used in concert with the X Render Extension and FreeType to implement
351 high quality, anti-aliased and subpixel rendered text on a display.")
352 ; The exact license is more X11-style than BSD-style.
353 (license (license:non-copyleft "file://COPYING"
354 "See COPYING in the distribution."))
355 (home-page "https://www.freedesktop.org/wiki/Software/fontconfig")))
356
357 (define-public t1lib
358 (package
359 (name "t1lib")
360 (version "5.1.2")
361 (source (origin
362 (method url-fetch)
363 (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
364 "graphics/" name "-" version ".tar.gz")
365 (string-append "https://fossies.org/linux/misc/old/"
366 name "-" version ".tar.gz")))
367 (sha256 (base32
368 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
369 (patches (search-patches
370 "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
371 "t1lib-CVE-2011-0764.patch"
372 "t1lib-CVE-2011-1552+.patch")))) ; 2011-1553, 2011-1554
373 (properties `((lint-hidden-cve . ("CVE-2011-0433"
374 "CVE-2011-1553"
375 "CVE-2011-1554"
376 "CVE-2011-5244"))))
377 (build-system gnu-build-system)
378 (arguments
379 ;; Making the documentation requires latex, but t1lib is also an input
380 ;; for building texlive.
381 `(#:tests? #f ; no test target
382 #:make-flags
383 '("without_doc")))
384 (synopsis "Library for generating bitmaps from Type 1 fonts")
385 (description
386 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
387 It is based on the code of the X11 rasteriser of the X11 project.
388
389 The bitmaps created by t1lib are returned in a data structure with type
390 GLYPH. This special GLYPH-type is also used in the X11 window system to
391 describe character bitmaps. It contains the bitmap data as well as some
392 metric information. But t1lib is in itself entirely independent of the
393 X11-system or any other graphical user interface.")
394 (license license:gpl2)
395 (home-page "http://www.t1lib.org/")))
396
397 (define-public teckit
398 (package
399 (name "teckit")
400 (version "2.5.9") ;signed by key 0xC9183BEA0288CDEE
401 (source
402 (origin
403 (method url-fetch)
404 (uri (string-append "https://github.com/silnrsi/teckit/releases/"
405 "download/v" version "/teckit-" version ".tar.gz"))
406 (sha256
407 (base32 "0gbxyip4wdibirdg2pvzayzyy927vxyd6dfyfiflx8zg88qzn8v8"))))
408 (build-system gnu-build-system)
409 (inputs
410 `(("zlib" ,zlib)
411 ("expat" ,expat)))
412 (native-inputs
413 `(("perl" ,perl))) ;for the tests
414 (synopsis "Toolkit for encoding conversions")
415 (description
416 "TECkit is a low-level toolkit intended to be used by other applications
417 that need to perform encoding conversions (e.g., when importing legacy data
418 into a Unicode-based application). The primary component of the TECkit
419 package is therefore a library that performs conversions; this is the
420 \"TECkit engine\". The engine relies on mapping tables in a specific binary
421 format (for which documentation is available); there is a compiler that
422 creates such tables from a human-readable mapping description (a simple
423 text file).
424
425 To facilitate the development and testing of mapping tables for TECkit,
426 several applications are also included in the current package; these
427 include simple tools for applying conversions to plain-text and Standard
428 Format files, as well as both command-line and simple GUI versions of the
429 TECkit compiler. However, it is not intended that these tools will be the
430 primary means by which end users perform conversions, and they have not
431 been designed, tested, and debugged to the extent that general-purpose
432 applications should be.")
433 (license license:lgpl2.1+)
434 (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
435
436 (define-public graphite2
437 (package
438 (name "graphite2")
439 (version "1.3.13")
440 (source
441 (origin
442 (method url-fetch)
443 (uri (string-append "https://github.com/silnrsi/graphite/releases/"
444 "download/" version "/" name "-" version ".tgz"))
445 (sha256
446 (base32
447 "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
448 (build-system cmake-build-system)
449 (arguments
450 `(#:phases (modify-phases %standard-phases
451 (add-after 'unpack 'adjust-test-PYTHONPATH
452 (lambda _
453 ;; Tell the build system not to override PYTHONPATH
454 ;; while running the Python tests.
455 (substitute* "Graphite.cmake"
456 (("ENVIRONMENT PYTHONPATH=")
457 (string-append "ENVIRONMENT PYTHONPATH="
458 (getenv "PYTHONPATH") ":")))
459 #t)))))
460 (native-inputs
461 `(("python" ,python)
462 ("python-fonttools" ,python-fonttools)))
463 (inputs
464 `(("freetype" ,freetype)))
465 (synopsis "Reimplementation of the SIL Graphite text processing engine")
466 (description
467 "Graphite2 is a reimplementation of the SIL Graphite text processing
468 engine. Graphite is a smart font technology designed to facilitate the
469 process known as shaping. This process takes an input Unicode text string
470 and returns a sequence of positioned glyphids from the font.")
471 (license license:lgpl2.1+)
472 (home-page "https://github.com/silnrsi/graphite")))
473
474 (define-public potrace
475 (package
476 (name "potrace")
477 (version "1.15")
478 (source
479 (origin
480 (method url-fetch)
481 (uri (string-append "mirror://sourceforge/potrace/" version
482 "/potrace-" version ".tar.gz"))
483 (sha256
484 (base32
485 "17ajildjp14shsy339xarh1lw1p0k60la08ahl638a73mh23kcx9"))
486 (patches (search-patches "potrace-tests.patch"))))
487 (build-system gnu-build-system)
488 (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
489 (inputs `(("zlib" ,zlib)))
490 (arguments
491 `(#:configure-flags
492 `("--with-libpotrace"))) ; install library and headers
493 (synopsis "Transform bitmaps into vector graphics")
494 (description
495 "Potrace is a tool for tracing a bitmap, which means, transforming a
496 bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
497 or BMP format), and the default output is an encapsulated PostScript
498 file (EPS). A typical use is to create EPS files from scanned data, such as
499 company or university logos, handwritten notes, etc. The resulting image is
500 not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
501 resolution.")
502 (license license:gpl2+)
503 (home-page "http://potrace.sourceforge.net/")))
504
505 (define-public libotf
506 (package
507 (name "libotf")
508 (version "0.9.16")
509 (source (origin
510 (method url-fetch)
511 (uri (string-append "mirror://savannah/m17n/libotf-"
512 version ".tar.gz"))
513 (sha256
514 (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
515 (build-system gnu-build-system)
516 (native-inputs
517 `(("pkg-config" ,pkg-config)))
518 (propagated-inputs
519 `(("freetype" ,freetype)))
520 (home-page "https://www.nongnu.org/m17n/")
521 (synopsis "Library for handling OpenType Font")
522 (description "This library can read Open Type Layout Tables from an OTF
523 file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
524 GPOS. It can convert a Unicode character sequence to a glyph code sequence by
525 using the above tables.")
526 (license license:lgpl2.0+)))
527
528 (define-public libspiro
529 (package
530 (name "libspiro")
531 (version "0.5.20150702")
532 (source
533 (origin
534 (method url-fetch)
535 (uri (string-append "https://github.com/fontforge/libspiro/releases"
536 "/download/" version "/libspiro-dist-" version ".tar.gz"))
537 (sha256
538 (base32
539 "153ckwj6h3wwlsgcppzqj8cymv1927hi8ar8fzpchq5q89cj2kai"))))
540 (build-system gnu-build-system)
541 (synopsis "Clothoid to bezier conversion library")
542 (description
543 "Raph Levien's Spiro package as a library. A mechanism for drawing
544 smooth contours with constant curvature at the spline joins.")
545 (license license:gpl2+)
546 (home-page "http://libspiro.sourceforge.net/")))
547
548 (define-public libuninameslist
549 (package
550 (name "libuninameslist")
551 (version "20190701")
552 (home-page "https://github.com/fontforge/libuninameslist")
553 (source
554 (origin
555 (method url-fetch)
556 (uri (string-append home-page "/releases/download/" version
557 "/libuninameslist-dist-" version ".tar.gz"))
558 (sha256
559 (base32
560 "18c9pcz81wm26q2m7npmvh9j3ibjs2hycxfh5xic2xgjfw40v2qn"))))
561 (build-system gnu-build-system)
562 (synopsis "Unicode names and annotation list")
563 (description
564 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
565 useful for programs that need Unicode \"Names\", \"Annotations\", and block
566 definitions.")
567 ;; COPYING specifies GPL2, but according to LICENSE it only covers the
568 ;; configure script. The actual code is BSD-3, and the Unicode data
569 ;; is governed by an X11-style license only found on the web.
570 (license (list license:bsd-3
571 (license:x11-style
572 "https://www.unicode.org/copyright.html#License")))))
573
574 (define-public fontforge
575 (package
576 (name "fontforge")
577 (version "20190801")
578 (source (origin
579 (method url-fetch)
580 (uri (string-append
581 "https://github.com/fontforge/fontforge/releases/download/"
582 version "/fontforge-" version ".tar.gz"))
583 (sha256
584 (base32 "0lh8yx01asbzxm6car5cfi64njh5p4lxc7iv8dldr5rwg357a86r"))))
585 (build-system gnu-build-system)
586 (native-inputs
587 `(("pkg-config" ,pkg-config)))
588 (inputs `(("cairo" ,cairo)
589 ("fontconfig" ,fontconfig) ;dlopen'd
590 ("freetype" ,freetype)
591 ("gettext" ,gettext-minimal)
592 ("libICE" ,libice)
593 ("libSM" ,libsm)
594 ("libX11" ,libx11)
595 ("libXi" ,libxi)
596 ("libjpeg" ,libjpeg)
597 ("libltdl" ,libltdl)
598 ("libpng" ,libpng)
599 ("libspiro" ,libspiro)
600 ("libtiff" ,libtiff)
601 ("libungif" ,libungif)
602 ("libuninameslist" ,libuninameslist)
603 ("libxft" ,libxft)
604 ("libxml2" ,libxml2)
605 ("pango" ,pango)
606 ("potrace" ,potrace)
607 ("python" ,python)
608 ("zlib" ,zlib)))
609 (arguments
610 '(#:phases
611 (modify-phases %standard-phases
612 (add-after 'install 'set-library-path
613 (lambda* (#:key inputs outputs #:allow-other-keys)
614 (let ((out (assoc-ref outputs "out"))
615 (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
616 (wrap-program (string-append out "/bin/fontforge")
617 ;; Fontforge dynamically opens libraries.
618 `("LD_LIBRARY_PATH" ":" prefix
619 ,(map (lambda (input)
620 (string-append (assoc-ref inputs input)
621 "/lib"))
622 '("libtiff" "libjpeg" "libpng" "libungif"
623 "libxml2" "zlib" "libspiro" "freetype"
624 "pango" "cairo" "fontconfig")))
625 ;; Checks for potrace program at runtime
626 `("PATH" ":" prefix (,potrace)))
627 #t))))))
628 (synopsis "Outline font editor")
629 (description
630 "FontForge allows you to create and modify postscript, truetype and
631 opentype fonts. You can save fonts in many different outline formats, and
632 generate bitmaps.")
633 (license license:gpl3+)
634 (home-page "https://fontforge.github.io")))
635
636 (define-public python2-ufolib
637 (package
638 (name "python2-ufolib")
639 (version "2.1.1")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (pypi-uri "ufoLib" version ".zip"))
644 (sha256
645 (base32 "07qy6mx7z0wi9a30lc2hj5i9q1gnz1n8l40dmjz2c19mj9s6mz9l"))))
646 (build-system python-build-system)
647 (arguments
648 `(#:python ,python-2))
649 (propagated-inputs
650 `(("python2-fonttools" ,python2-fonttools)))
651 (native-inputs
652 `(("unzip" ,unzip)
653 ("python2-pytest" ,python2-pytest)
654 ("python2-pytest-runner" ,python2-pytest-runner)))
655 (home-page "https://github.com/unified-font-object/ufoLib")
656 (synopsis "Low-level UFO reader and writer")
657 (description
658 "UfoLib reads and writes Unified Font Object (UFO)
659 files. UFO is a file format that stores fonts source files.")
660 (license license:bsd-3)))
661
662 (define-public python2-defcon
663 (package
664 (name "python2-defcon")
665 (version "0.3.5")
666 (source
667 (origin
668 (method url-fetch)
669 (uri (pypi-uri "defcon" version ".zip"))
670 (sha256
671 (base32
672 "03jlm2gy9lvbwj68kfdm43yaddwd634jwkdg4wf0jxx2s8mwbg22"))))
673 (build-system python-build-system)
674 (arguments
675 `(#:python ,python-2))
676 (native-inputs
677 `(("unzip" ,unzip)
678 ("python2-pytest" ,python2-pytest)
679 ("python2-pytest-runner" ,python2-pytest-runner)))
680 (propagated-inputs
681 `(("python2-fonttools" ,python2-fonttools)
682 ("python2-ufolib" ,python2-ufolib)))
683 (home-page "https://pypi.org/project/defcon/")
684 (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data")
685 (description
686 "Defcon is a set of @acronym{UFO, unified font object} based objects
687 optimized for use in font editing applications. The objects are built to
688 be lightweight, fast and flexible. The objects are very bare-bones and
689 they are not meant to be end-all, be-all objects. Rather, they are meant
690 to provide base functionality so that you can focus on your application’s
691 behavior, not object observing or maintaining cached data. Defcon
692 implements UFO3 as described by the UFO font format.")
693 (license license:expat)))
694
695 (define-public nototools
696 (package
697 (name "nototools")
698 (version "20170925")
699 (source
700 (origin
701 (method url-fetch)
702 (uri (string-append "https://github.com/googlei18n/nototools/"
703 "archive/v2017-09-25-tooling-for-phase3-"
704 "update.tar.gz"))
705 (file-name (string-append name "-" version ".tar.gz"))
706 (sha256
707 (base32
708 "1pvacw18cm9l4sb66pqyjc7hc74xhhfxc7kd5ald8lixf4wzg0s8"))))
709 (build-system python-build-system)
710 (arguments
711 `(#:python ,python-2))
712 (propagated-inputs
713 `(("python2-booleanoperations" ,python2-booleanoperations)
714 ("python2-defcon" ,python2-defcon)
715 ("python2-fonttools" ,python2-fonttools)
716 ("python2-pillow" ,python2-pillow)
717 ("python2-pyclipper" ,python2-pyclipper)
718 ("python2-ufolib" ,python2-ufolib)))
719 (home-page "https://github.com/googlei18n/nototools")
720 (synopsis "Noto fonts support tools and scripts")
721 (description
722 "Nototools is a Python package containing Python scripts used to
723 maintain the Noto Fonts project.")
724 (license (list license:asl2.0
725 ;; Sample texts are attributed to UN and OHCHR.
726 ;; The permissions on the UDHR are pretty lax:
727 ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
728 ;; "If UDHR translations or materials are reproduced, users
729 ;; should make reference to this website as a source by
730 ;; providing a link."
731 license:public-domain
732 (license:non-copyleft
733 "file://sample_texts/attributions.txt"
734 "See sample_texts/attributions.txt in the distribution.")))))
735
736 (define-public fontmanager
737 (package
738 (name "fontmanager")
739 (version "0.7.5")
740 (source
741 (origin
742 (method git-fetch)
743 (uri (git-reference
744 (url "https://github.com/FontManager/font-manager")
745 (commit version)))
746 (file-name (git-file-name name version))
747 (sha256
748 (base32
749 "16hma8rrkam6ngn5vbdaryn31vdixvii6920g9z928gylz9xkd3g"))))
750 (build-system meson-build-system)
751 (arguments
752 `(#:glib-or-gtk? #t
753 #:build-type "release"
754 #:configure-flags
755 (list (string-append "-Dc_link_args=-Wl,-rpath="
756 (assoc-ref %outputs "out")
757 "/lib/font-manager"))))
758 (native-inputs
759 `(("pkg-config" ,pkg-config)
760 ("vala" ,vala)
761 ("yelp-tools" ,yelp-tools)
762 ("gettext" ,gettext-minimal)
763 ("glib" ,glib "bin")
764 ("gobject-introspection" ,gobject-introspection)
765 ("desktop-file-utils" ,desktop-file-utils)))
766 (inputs
767 `(("json-glib" ,json-glib)
768 ("sqlite-with-column-metadata" ,sqlite-with-column-metadata)
769 ("fonconfig" ,fontconfig)
770 ("freetype" ,freetype)
771 ("gtk+" ,gtk+)))
772 (home-page "https://fontmanager.github.io/")
773 (synopsis "Simple font management for GTK+ desktop environments")
774 (description "Font Manager is intended to provide a way for users to
775 easily manage desktop fonts, without having to resort to command-line
776 tools or editing configuration files by hand.
777 While designed primarily with the GNOME Desktop Environment in mind, it should
778 work well with other GTK+ desktop environments.")
779 (license license:gpl3+)))
780
781 (define-public fntsample
782 (package
783 (name "fntsample")
784 (version "5.3")
785 (source (origin
786 (method url-fetch)
787 (uri (string-append
788 "https://github.com/eugmes/fntsample/archive/release/"
789 version ".tar.gz"))
790 (file-name (string-append name "-" version ".tar.gz"))
791 (sha256
792 (base32
793 "0awp4dh1g40ivzvm5xqlvcpcdw1vplrx3drjmbylr62y185vbs74"))))
794 (build-system cmake-build-system)
795 (arguments
796 `(#:tests? #f ; There are no tests.
797 #:configure-flags
798 (list (string-append
799 "-DUNICODE_BLOCKS=" (assoc-ref %build-inputs "unicode-blocks")))
800 #:phases
801 (modify-phases %standard-phases
802 (add-after 'install 'set-library-path
803 (lambda* (#:key inputs outputs #:allow-other-keys)
804 (let* ((out (assoc-ref outputs "out"))
805 (pdf-api2 (assoc-ref inputs "perl-pdf-api2"))
806 (intl (assoc-ref inputs "perl-libintl-perl"))
807 (perllib (string-append pdf-api2
808 "/lib/perl5/site_perl/"
809 ,(package-version perl)
810 ":" intl
811 "/lib/perl5/site_perl/"
812 ,(package-version perl))))
813 (wrap-program (string-append out "/bin/pdfoutline")
814 `("PERL5LIB" ":" prefix (,perllib)))
815 #t))))))
816 (native-inputs
817 `(("pkg-config" ,pkg-config)
818 ("gettext" ,gettext-minimal)))
819 (inputs
820 `(("cairo" ,cairo)
821 ("fontconfig" ,fontconfig)
822 ("freetype" ,freetype)
823 ("glib" ,glib)
824 ("pango" ,pango)
825 ("perl-pdf-api2" ,perl-pdf-api2)
826 ("perl-libintl-perl" ,perl-libintl-perl)
827 ("unicode-blocks"
828 ,(origin
829 (method url-fetch)
830 (uri "https://unicode.org/Public/UNIDATA/Blocks.txt")
831 (file-name "unicode-blocks.txt")
832 (sha256
833 (base32
834 "1xs8fnhh48gs41wg004r7m4r2azh9khmyjjlnvyzy9c6zrd212x2"))))))
835 (home-page "https://github.com/eugmes/fntsample")
836 (synopsis "PDF and PostScript font samples generator")
837 (description "This package provides a tool that can be used to make font
838 samples that show coverage of the font and are similar in appearance to
839 Unicode Charts. It was developed for use with DejaVu Fonts project.")
840 (license license:gpl3+)))
841
842 (define-public libraqm
843 (package
844 (name "libraqm")
845 (version "0.7.0")
846 (source
847 (origin
848 (method url-fetch)
849 (uri (string-append "https://github.com/HOST-Oman/libraqm/"
850 "releases/download/v" version "/"
851 "raqm-" version ".tar.gz"))
852 (sha256
853 (base32 "0hgry3fj2y3qaq2fnmdgd93ixkk3ns5jds4vglkiv2jfvpn7b1g2"))))
854 (build-system gnu-build-system)
855 (arguments
856 `(#:configure-flags (list "--disable-static")))
857 (native-inputs
858 `(("gtk-doc" ,gtk-doc)
859 ("pkg-config" ,pkg-config)
860 ("python" ,python-wrapper)))
861 (inputs
862 `(("freetype" ,freetype)
863 ("fribidi" ,fribidi)
864 ("harfbuzz" ,harfbuzz)))
865 (home-page "https://github.com/HOST-Oman/libraqm")
866 (synopsis "Library for complex text layout")
867 (description
868 "Raqm is a small library that encapsulates the logic for complex text
869 layout and provides a convenient API.
870
871 It currently provides bidirectional text support (using FriBiDi),
872 shaping (using HarfBuzz), and proper script itemization. As a result, Raqm
873 can support most writing systems covered by Unicode.")
874 (license license:expat)))