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