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