Merge branch 'staging' into core-updates
[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 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.9") ;signed by key 0xC9183BEA0288CDEE
393 (source
394 (origin
395 (method url-fetch)
396 (uri (string-append "https://github.com/silnrsi/teckit/releases/"
397 "download/v" version "/teckit-" version ".tar.gz"))
398 (sha256
399 (base32 "0gbxyip4wdibirdg2pvzayzyy927vxyd6dfyfiflx8zg88qzn8v8"))))
400 (build-system gnu-build-system)
401 (inputs
402 `(("zlib" ,zlib)
403 ("expat" ,expat)))
404 (native-inputs
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.13")
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 "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
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 "20190305")
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 "1rwd2bgcyvign9agyjsr3v2fr9j1cg2wi6g0z2wwg1az32scknwq"))))
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 "20190317")
559 (source (origin
560 (method url-fetch)
561 (uri (string-append
562 "https://github.com/fontforge/fontforge/releases/download/"
563 version "/fontforge-" version ".tar.gz"))
564 (sha256 (base32
565 "1ddqbpc32cgbccdnv0lfw0qhj59hcqzb7616ph5lkvm91pnas4dp"))))
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 ;; FIXME: We use Python 2 here because there is a bug in Python
590 ;; 3.7 that is triggered when Py_Main is called after Py_Init, as
591 ;; is done by fontforge. This will be fixed in Python 3.7.1.
592 ("python" ,python-2)
593 ("zlib" ,zlib)))
594 (arguments
595 '(#:phases
596 (modify-phases %standard-phases
597 (add-after 'install 'set-library-path
598 (lambda* (#:key inputs outputs #:allow-other-keys)
599 (let ((out (assoc-ref outputs "out"))
600 (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
601 (wrap-program (string-append out "/bin/fontforge")
602 ;; Fontforge dynamically opens libraries.
603 `("LD_LIBRARY_PATH" ":" prefix
604 ,(map (lambda (input)
605 (string-append (assoc-ref inputs input)
606 "/lib"))
607 '("libtiff" "libjpeg" "libpng" "libungif"
608 "libxml2" "zlib" "libspiro" "freetype"
609 "pango" "cairo" "fontconfig")))
610 ;; Checks for potrace program at runtime
611 `("PATH" ":" prefix (,potrace)))
612 #t))))))
613 (synopsis "Outline font editor")
614 (description
615 "FontForge allows you to create and modify postscript, truetype and
616 opentype fonts. You can save fonts in many different outline formats, and
617 generate bitmaps.")
618 (license license:gpl3+)
619 (home-page "https://fontforge.github.io/en-US/")))
620
621 (define-public python2-ufolib
622 (package
623 (name "python2-ufolib")
624 (version "2.1.1")
625 (source
626 (origin
627 (method url-fetch)
628 (uri (pypi-uri "ufoLib" version ".zip"))
629 (sha256
630 (base32 "07qy6mx7z0wi9a30lc2hj5i9q1gnz1n8l40dmjz2c19mj9s6mz9l"))))
631 (build-system python-build-system)
632 (arguments
633 `(#:python ,python-2))
634 (propagated-inputs
635 `(("python2-fonttools" ,python2-fonttools)))
636 (native-inputs
637 `(("unzip" ,unzip)
638 ("python2-pytest" ,python2-pytest)
639 ("python2-pytest-runner" ,python2-pytest-runner)))
640 (home-page "https://github.com/unified-font-object/ufoLib")
641 (synopsis "Low-level UFO reader and writer")
642 (description
643 "UfoLib reads and writes Unified Font Object (UFO)
644 files. UFO is a file format that stores fonts source files.")
645 (license license:bsd-3)))
646
647 (define-public python2-defcon
648 (package
649 (name "python2-defcon")
650 (version "0.3.5")
651 (source
652 (origin
653 (method url-fetch)
654 (uri (pypi-uri "defcon" version ".zip"))
655 (sha256
656 (base32
657 "03jlm2gy9lvbwj68kfdm43yaddwd634jwkdg4wf0jxx2s8mwbg22"))))
658 (build-system python-build-system)
659 (arguments
660 `(#:python ,python-2))
661 (native-inputs
662 `(("unzip" ,unzip)
663 ("python2-pytest" ,python2-pytest)
664 ("python2-pytest-runner" ,python2-pytest-runner)))
665 (propagated-inputs
666 `(("python2-fonttools" ,python2-fonttools)
667 ("python2-ufolib" ,python2-ufolib)))
668 (home-page "https://pypi.python.org/pypi/defcon")
669 (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data")
670 (description
671 "Defcon is a set of @acronym{UFO, unified font object} based objects
672 optimized for use in font editing applications. The objects are built to
673 be lightweight, fast and flexible. The objects are very bare-bones and
674 they are not meant to be end-all, be-all objects. Rather, they are meant
675 to provide base functionality so that you can focus on your application’s
676 behavior, not object observing or maintaining cached data. Defcon
677 implements UFO3 as described by the UFO font format.")
678 (license license:expat)))
679
680 (define-public nototools
681 (package
682 (name "nototools")
683 (version "20170925")
684 (source
685 (origin
686 (method url-fetch)
687 (uri (string-append "https://github.com/googlei18n/nototools/"
688 "archive/v2017-09-25-tooling-for-phase3-"
689 "update.tar.gz"))
690 (file-name (string-append name "-" version ".tar.gz"))
691 (sha256
692 (base32
693 "1pvacw18cm9l4sb66pqyjc7hc74xhhfxc7kd5ald8lixf4wzg0s8"))))
694 (build-system python-build-system)
695 (arguments
696 `(#:python ,python-2))
697 (propagated-inputs
698 `(("python2-booleanoperations" ,python2-booleanoperations)
699 ("python2-defcon" ,python2-defcon)
700 ("python2-fonttools" ,python2-fonttools)
701 ("python2-pillow" ,python2-pillow)
702 ("python2-pyclipper" ,python2-pyclipper)
703 ("python2-ufolib" ,python2-ufolib)))
704 (home-page "https://github.com/googlei18n/nototools")
705 (synopsis "Noto fonts support tools and scripts")
706 (description
707 "Nototools is a Python package containing Python scripts used to
708 maintain the Noto Fonts project.")
709 (license (list license:asl2.0
710 ;; Sample texts are attributed to UN and OHCHR.
711 ;; The permissions on the UDHR are pretty lax:
712 ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
713 ;; "If UDHR translations or materials are reproduced, users
714 ;; should make reference to this website as a source by
715 ;; providing a link."
716 license:public-domain
717 (license:non-copyleft
718 "file://sample_texts/attributions.txt"
719 "See sample_texts/attributions.txt in the distribution.")))))