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