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