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