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