gnu: emacs: Remove unneeded import.
[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>
7670efef 11;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
6e3cbafb 12;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
cc51c03f 13;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
a1797f32 14;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
b387a1c5
AE
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
a86177d6 31(define-module (gnu packages fontutils)
b387a1c5 32 #:use-module (gnu packages)
e5c0701f 33 #:use-module (gnu packages compression)
427a51fd 34 #:use-module (gnu packages check)
b972db72 35 #:use-module (gnu packages ghostscript)
019c0eda 36 #:use-module (gnu packages linux)
319e2d17 37 #:use-module (gnu packages perl)
6e4da6ea 38 #:use-module (gnu packages pkg-config)
f945bf06 39 #:use-module (gnu packages autotools)
0c115d8c 40 #:use-module (gnu packages gettext)
319e2d17 41 #:use-module (gnu packages python)
44d10b1f 42 #:use-module (gnu packages python-xyz)
0c115d8c 43 #:use-module (gnu packages image)
1e69db8f
EB
44 #:use-module (gnu packages bison)
45 #:use-module (gnu packages flex)
0c115d8c 46 #:use-module (gnu packages glib)
70564e71 47 #:use-module (gnu packages gperf)
0c115d8c 48 #:use-module (gnu packages xorg)
a1797f32 49 #:use-module (gnu packages fribidi)
0c115d8c 50 #:use-module (gnu packages gtk)
6e4da6ea 51 #:use-module (gnu packages xml)
ad8aaf47
BD
52 #:use-module (gnu packages sqlite)
53 #:use-module (gnu packages gnome)
54 #:use-module (gnu packages freedesktop)
b5b73a82 55 #:use-module ((guix licenses) #:prefix license:)
b387a1c5
AE
56 #:use-module (guix packages)
57 #:use-module (guix download)
1436c5c7 58 #:use-module (guix svn-download)
579760d0 59 #:use-module (guix git-download)
319e2d17 60 #:use-module (guix build-system cmake)
427a51fd 61 #:use-module (guix build-system gnu)
ad8aaf47 62 #:use-module (guix build-system python)
4affa918
MB
63 #:use-module (guix build-system meson)
64 #:use-module (guix utils)
65 #:use-module (srfi srfi-1))
b387a1c5
AE
66
67(define-public freetype
68 (package
69 (name "freetype")
e81b14f0 70 (version "2.10.1")
b387a1c5
AE
71 (source (origin
72 (method url-fetch)
36ee486f 73 (uri (string-append "mirror://savannah/freetype/freetype-"
e81b14f0 74 version ".tar.xz"))
b387a1c5 75 (sha256 (base32
e81b14f0 76 "0vx2dg1jh5kq34dd6ifpjywkpapp8a7p1bvyq9yq5zi1i94gmnqn"))))
b387a1c5 77 (build-system gnu-build-system)
695c501d
RW
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")))
6983ba56
SB
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)))
35b9e423 89 (synopsis "Font rendering library")
b387a1c5
AE
90 (description
91 "Freetype is a library that can be used by applications to access the
35b9e423 92contents of font files. It provides a uniform interface to access font files.
b387a1c5 93It supports both bitmap and scalable formats, including TrueType, OpenType,
35b9e423 94Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
b387a1c5 95anti-aliased glyph bitmap generation with 256 gray levels.")
79c398a2 96 (license license:freetype) ; some files have other licenses
c70047f1 97 (home-page "https://www.freetype.org/")))
6e4da6ea 98
1e69db8f
EB
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
125finely hand-hinting the last 1%. It is ideal for web fonts and supports many
126scripts.")
127 (license (list license:gpl2+ license:freetype)) ;choose one or the other
44ff40c2 128 (home-page "https://www.freetype.org/ttfautohint/")))
1e69db8f 129
508a85df
EB
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
164Converts OpenType fonts to WOFF fonts
165@item woff2sfnt
166Converts 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
1555aee7
EB
171(define-public ttf2eot
172 (package
173 (name "ttf2eot")
af18fff0 174 (version "0.0.3")
1555aee7
EB
175 (source
176 (origin
af18fff0
TGR
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))
1555aee7
EB
182 (sha256
183 (base32
af18fff0 184 "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
1555aee7
EB
185 (patches (list (search-patch "ttf2eot-cstddef.patch")))))
186 (build-system gnu-build-system)
187 (arguments
af18fff0 188 `(#:tests? #f ; no tests
1555aee7
EB
189 #:phases
190 (modify-phases %standard-phases
af18fff0
TGR
191 (delete 'configure) ; no configuration
192 (replace 'install ; no install target
1555aee7
EB
193 (lambda* (#:key outputs #:allow-other-keys)
194 (let* ((out (assoc-ref outputs "out"))
195 (bin (string-append out "/bin")))
bf43e133
TGR
196 (install-file "ttf2eot" bin)
197 #t))))))
1555aee7
EB
198 (synopsis "Convert from TrueType to Embeddable Open Type")
199 (description
200 "This package contains a commandline wrapper around OpenTypeUtilities.cpp
201from Chromium, used to make EOT (Embeddable Open Type) files from
202TTF (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)
af18fff0 207 (home-page "https://github.com/wget/ttf2eot")))
1555aee7 208
64965a06
LC
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
252supported 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
254poorly hinted Adobe Type 1 font through the FreeType library and get it back
255with freshly generated hints. The files produced by default are in
256human-readable form, which further needs to be encoded with t1utilities to
257work with most software requiring Type 1 fonts.")
258 (home-page "http://ttf2pt1.sourceforge.net/")
259 (license license:bsd-3)))
260
579760d0 261(define-public woff2
d9476a37
LDB
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
579760d0 288fonts to/from the WOFF2 format.")
d9476a37
LDB
289 (license license:asl2.0)
290 (home-page "https://github.com/google/woff2")))
579760d0 291
6e4da6ea
AE
292(define-public fontconfig
293 (package
294 (name "fontconfig")
529c3622 295 (version "2.13.1")
6e4da6ea
AE
296 (source (origin
297 (method url-fetch)
298 (uri (string-append
5cc3096c 299 "https://www.freedesktop.org/software/fontconfig/release/fontconfig-"
6e4da6ea 300 version ".tar.bz2"))
9dd9e8fa 301 (patches (search-patches "fontconfig-hurd-path-max.patch"))
6e4da6ea 302 (sha256 (base32
529c3622 303 "0hb700a68kk0ip51wdlnjjc682kvlrmb6q920mzajykdk0mdsmgn"))))
6e4da6ea 304 (build-system gnu-build-system)
019c0eda 305 ;; In Requires or Requires.private of fontconfig.pc.
80650d77 306 (propagated-inputs `(("expat" ,expat)
019c0eda 307 ("freetype" ,freetype)
bb93042c 308 ("libuuid" ,util-linux "lib")))
80650d77 309 (inputs `(("gs-fonts" ,gs-fonts)))
c4c4cc05 310 (native-inputs
2b174b4e 311 `(("gperf" ,gperf)
70564e71 312 ("pkg-config" ,pkg-config)))
0ceea4f3 313 (arguments
030fa12e
SB
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")
e71ef7ad 320
f8835ff4
AK
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")
e71ef7ad 325
030fa12e
SB
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.
21398eda
MW
333 (invoke "make" "install"
334 "fc_cachedir=$(TMPDIR)"
335 "RUN_FC_CACHE_TEST=false"))))))
9e771e3b 336 (synopsis "Library for configuring and customizing font access")
6e4da6ea
AE
337 (description
338 "Fontconfig can discover new fonts when installed automatically;
339perform font name substitution, so that appropriate alternative fonts can
340be selected if fonts are missing;
341identify the set of fonts required to completely cover a set of languages;
342have GUI configuration tools built as it uses an XML-based configuration file;
343efficiently and quickly find needed fonts among the set of installed fonts;
344be used in concert with the X Render Extension and FreeType to implement
345high quality, anti-aliased and subpixel rendered text on a display.")
346 ; The exact license is more X11-style than BSD-style.
166191b3 347 (license (license:non-copyleft "file://COPYING"
6e4da6ea 348 "See COPYING in the distribution."))
57e7d748 349 (home-page "https://www.freedesktop.org/wiki/Software/fontconfig")))
313b9012
AE
350
351(define-public t1lib
352 (package
353 (name "t1lib")
354 (version "5.1.2")
355 (source (origin
356 (method url-fetch)
a60c705b
EF
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")))
313b9012 361 (sha256 (base32
4f3e02f1
EF
362 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
363 (patches (search-patches
9c2d2c13 364 "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
4f3e02f1 365 "t1lib-CVE-2011-0764.patch"
9c2d2c13
EF
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"))))
313b9012
AE
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")))
9e771e3b 378 (synopsis "Library for generating bitmaps from Type 1 fonts")
313b9012
AE
379 (description
380 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
381It is based on the code of the X11 rasteriser of the X11 project.
382
383The bitmaps created by t1lib are returned in a data structure with type
35b9e423
EB
384GLYPH. This special GLYPH-type is also used in the X11 window system to
385describe character bitmaps. It contains the bitmap data as well as some
386metric information. But t1lib is in itself entirely independent of the
387X11-system or any other graphical user interface.")
313b9012 388 (license license:gpl2)
d716a474 389 (home-page "https://www.t1lib.org/")))
e5c0701f
AE
390
391(define-public teckit
392 (package
93a55838 393 (name "teckit")
792d526a 394 (version "2.5.9") ;signed by key 0xC9183BEA0288CDEE
93a55838
MB
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
792d526a 401 (base32 "0gbxyip4wdibirdg2pvzayzyy927vxyd6dfyfiflx8zg88qzn8v8"))))
93a55838 402 (build-system gnu-build-system)
9d2c24d2
MB
403 (arguments
404 '(#:configure-flags '("--disable-static")))
93a55838
MB
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
e5c0701f 413that need to perform encoding conversions (e.g., when importing legacy data
35b9e423 414into a Unicode-based application). The primary component of the TECkit
e5c0701f 415package is therefore a library that performs conversions; this is the
35b9e423 416\"TECkit engine\". The engine relies on mapping tables in a specific binary
e5c0701f
AE
417format (for which documentation is available); there is a compiler that
418creates such tables from a human-readable mapping description (a simple
419text file).
420
421To facilitate the development and testing of mapping tables for TECkit,
422several applications are also included in the current package; these
423include simple tools for applying conversions to plain-text and Standard
424Format files, as well as both command-line and simple GUI versions of the
35b9e423 425TECkit compiler. However, it is not intended that these tools will be the
e5c0701f
AE
426primary means by which end users perform conversions, and they have not
427been designed, tested, and debugged to the extent that general-purpose
428applications should be.")
93a55838
MB
429 (license license:lgpl2.1+)
430 (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
319e2d17
AE
431
432(define-public graphite2
433 (package
434 (name "graphite2")
8152024c 435 (version "1.3.13")
319e2d17
AE
436 (source
437 (origin
438 (method url-fetch)
6983ba56
SB
439 (uri (string-append "https://github.com/silnrsi/graphite/releases/"
440 "download/" version "/" name "-" version ".tgz"))
319e2d17 441 (sha256
297a36ab 442 (base32
8152024c 443 "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
319e2d17 444 (build-system cmake-build-system)
c4fa3918
MB
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)))))
e6f22a82 456 (native-inputs
c4fa3918
MB
457 `(("python" ,python)
458 ("python-fonttools" ,python-fonttools)))
319e2d17 459 (inputs
e6f22a82 460 `(("freetype" ,freetype)))
35b9e423 461 (synopsis "Reimplementation of the SIL Graphite text processing engine")
319e2d17
AE
462 (description
463 "Graphite2 is a reimplementation of the SIL Graphite text processing
464engine. Graphite is a smart font technology designed to facilitate the
465process known as shaping. This process takes an input Unicode text string
466and returns a sequence of positioned glyphids from the font.")
467 (license license:lgpl2.1+)
e86409c5 468 (home-page "https://github.com/silnrsi/graphite")))
ee69f85c
EB
469
470(define-public potrace
471 (package
472 (name "potrace")
d9ff6ad8 473 (version "1.16")
ee69f85c
EB
474 (source
475 (origin
476 (method url-fetch)
de67e922
LF
477 (uri (string-append "mirror://sourceforge/potrace/" version
478 "/potrace-" version ".tar.gz"))
ee69f85c
EB
479 (sha256
480 (base32
d9ff6ad8 481 "1k3sxgjqq0jnpk9xxys05q32sl5hbf1lbk1gmfxcrmpdgnhli0my"))))
ee69f85c
EB
482 (build-system gnu-build-system)
483 (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
484 (inputs `(("zlib" ,zlib)))
4797d84d
AE
485 (arguments
486 `(#:configure-flags
487 `("--with-libpotrace"))) ; install library and headers
ee69f85c
EB
488 (synopsis "Transform bitmaps into vector graphics")
489 (description
490 "Potrace is a tool for tracing a bitmap, which means, transforming a
491bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
492or BMP format), and the default output is an encapsulated PostScript
493file (EPS). A typical use is to create EPS files from scanned data, such as
494company or university logos, handwritten notes, etc. The resulting image is
495not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
496resolution.")
497 (license license:gpl2+)
498 (home-page "http://potrace.sourceforge.net/")))
5277dbb0 499
6ef0ec76
RJ
500(define-public libotf
501 (package
502 (name "libotf")
9b9e7481 503 (version "0.9.16")
6ef0ec76
RJ
504 (source (origin
505 (method url-fetch)
6a703976
MW
506 (uri (string-append "mirror://savannah/m17n/libotf-"
507 version ".tar.gz"))
6ef0ec76 508 (sha256
9b9e7481 509 (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
6ef0ec76 510 (build-system gnu-build-system)
48342a04
MB
511 (native-inputs
512 `(("pkg-config" ,pkg-config)))
6ef0ec76
RJ
513 (propagated-inputs
514 `(("freetype" ,freetype)))
340978d7 515 (home-page "https://www.nongnu.org/m17n/")
6ef0ec76
RJ
516 (synopsis "Library for handling OpenType Font")
517 (description "This library can read Open Type Layout Tables from an OTF
518file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
519GPOS. It can convert a Unicode character sequence to a glyph code sequence by
520using the above tables.")
521 (license license:lgpl2.0+)))
522
5277dbb0
EB
523(define-public libspiro
524 (package
525 (name "libspiro")
600037b3 526 (version "20190731")
5277dbb0
EB
527 (source
528 (origin
529 (method url-fetch)
24950127 530 (uri (string-append "https://github.com/fontforge/libspiro/releases"
600037b3 531 "/download/" version "/libspiro-" version ".tar.gz"))
5277dbb0
EB
532 (sha256
533 (base32
600037b3 534 "0m63x97b7aciviijprvy85gm03p2jsgslxn323zl9zn7qz6d3ir4"))))
5277dbb0 535 (build-system gnu-build-system)
06639876
MB
536 (arguments
537 '(#:configure-flags '("--disable-static")))
5277dbb0
EB
538 (synopsis "Clothoid to bezier conversion library")
539 (description
540 "Raph Levien's Spiro package as a library. A mechanism for drawing
541smooth contours with constant curvature at the spline joins.")
542 (license license:gpl2+)
543 (home-page "http://libspiro.sourceforge.net/")))
f945bf06
EB
544
545(define-public libuninameslist
546 (package
547 (name "libuninameslist")
3db5a01c 548 (version "20200313")
27b73b49 549 (home-page "https://github.com/fontforge/libuninameslist")
f945bf06
EB
550 (source
551 (origin
552 (method url-fetch)
27b73b49
MB
553 (uri (string-append home-page "/releases/download/" version
554 "/libuninameslist-dist-" version ".tar.gz"))
f945bf06
EB
555 (sha256
556 (base32
3db5a01c 557 "10ri80c64xb4rhbif3sr87y5vhi3m702zb0m02imvj1jib9rq0m8"))))
f945bf06 558 (build-system gnu-build-system)
f945bf06
EB
559 (synopsis "Unicode names and annotation list")
560 (description
561 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
562useful for programs that need Unicode \"Names\", \"Annotations\", and block
563definitions.")
b19c92ef
MB
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
27b73b49 569 "https://www.unicode.org/copyright.html#License")))))
0c115d8c
EB
570
571(define-public fontforge
572 (package
573 (name "fontforge")
0a502c8c 574 (version "20200314")
0c115d8c
EB
575 (source (origin
576 (method url-fetch)
56586557
AE
577 (uri (string-append
578 "https://github.com/fontforge/fontforge/releases/download/"
0a502c8c 579 version "/fontforge-" version ".tar.xz"))
3b08c873 580 (sha256
0a502c8c
MB
581 (base32 "0qf88wd6riycq56d24brybyc93ns74s0nyyavm43zp2kfcihn6fd"))))
582 (build-system cmake-build-system)
56586557 583 (native-inputs
0a502c8c 584 `(("pkg-config" ,pkg-config)))
56586557
AE
585 (inputs `(("cairo" ,cairo)
586 ("fontconfig" ,fontconfig) ;dlopen'd
587 ("freetype" ,freetype)
b94a6ca0 588 ("gettext" ,gettext-minimal)
0c115d8c
EB
589 ("libICE" ,libice)
590 ("libSM" ,libsm)
56586557
AE
591 ("libX11" ,libx11)
592 ("libXi" ,libxi)
4bd428a7 593 ("libjpeg" ,libjpeg-turbo)
56586557
AE
594 ("libltdl" ,libltdl)
595 ("libpng" ,libpng)
0c115d8c 596 ("libspiro" ,libspiro)
56586557 597 ("libtiff" ,libtiff)
de946028 598 ("libungif" ,libungif)
0c115d8c 599 ("libuninameslist" ,libuninameslist)
56586557
AE
600 ("libxft" ,libxft)
601 ("libxml2" ,libxml2)
0c115d8c 602 ("pango" ,pango)
56586557 603 ("potrace" ,potrace)
01a92a70 604 ("python" ,python)
56586557 605 ("zlib" ,zlib)))
0c115d8c 606 (arguments
0a502c8c
MB
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
5ab869f9 612 (modify-phases %standard-phases
0a502c8c 613 (add-after 'unpack 'do-not-override-RPATH
6e3cbafb 614 (lambda _
0a502c8c
MB
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 ""))
6e3cbafb 620 #t))
5ab869f9
EB
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"))
de946028 631 '("libtiff" "libjpeg" "libpng" "libungif"
5ab869f9
EB
632 "libxml2" "zlib" "libspiro" "freetype"
633 "pango" "cairo" "fontconfig")))
634 ;; Checks for potrace program at runtime
2f3f8ae0 635 `("PATH" ":" prefix (,potrace)))
5dd7bd12 636 #t))))))
0c115d8c
EB
637 (synopsis "Outline font editor")
638 (description
639 "FontForge allows you to create and modify postscript, truetype and
640opentype fonts. You can save fonts in many different outline formats, and
641generate bitmaps.")
56586557 642 (license license:gpl3+)
3ab8c224 643 (home-page "https://fontforge.github.io")))
427a51fd 644
4affa918
MB
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
427a51fd 670(define-public python2-ufolib
671 (package
672 (name "python2-ufolib")
a82bb552 673 (version "2.1.1")
427a51fd 674 (source
675 (origin
676 (method url-fetch)
677 (uri (pypi-uri "ufoLib" version ".zip"))
678 (sha256
a82bb552 679 (base32 "07qy6mx7z0wi9a30lc2hj5i9q1gnz1n8l40dmjz2c19mj9s6mz9l"))))
427a51fd 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)
e09bb8a4 687 ("python2-pytest" ,python2-pytest)
427a51fd 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)
693files. UFO is a file format that stores fonts source files.")
694 (license license:bsd-3)))
3715aff5 695
696(define-public python2-defcon
697 (package
698 (name "python2-defcon")
e6d7686f 699 (version "0.3.5")
3715aff5 700 (source
701 (origin
702 (method url-fetch)
703 (uri (pypi-uri "defcon" version ".zip"))
704 (sha256
705 (base32
e6d7686f 706 "03jlm2gy9lvbwj68kfdm43yaddwd634jwkdg4wf0jxx2s8mwbg22"))))
3715aff5 707 (build-system python-build-system)
708 (arguments
709 `(#:python ,python-2))
710 (native-inputs
711 `(("unzip" ,unzip)
e09bb8a4 712 ("python2-pytest" ,python2-pytest)
3715aff5 713 ("python2-pytest-runner" ,python2-pytest-runner)))
714 (propagated-inputs
715 `(("python2-fonttools" ,python2-fonttools)
716 ("python2-ufolib" ,python2-ufolib)))
e85af137 717 (home-page "https://pypi.org/project/defcon/")
3715aff5 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
721optimized for use in font editing applications. The objects are built to
722be lightweight, fast and flexible. The objects are very bare-bones and
723they are not meant to be end-all, be-all objects. Rather, they are meant
724to provide base functionality so that you can focus on your application’s
725behavior, not object observing or maintaining cached data. Defcon
726implements UFO3 as described by the UFO font format.")
727 (license license:expat)))
20d2c6e7 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
757maintain 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.")))))
ad8aaf47
BD
769
770(define-public fontmanager
771 (package
772 (name "fontmanager")
3a5d1c9b 773 (version "0.7.7")
ad8aaf47
BD
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
3a5d1c9b 783 "1bzqvspplp1zj0n0869jqbc60wgbjhf0vdrn5bj8dfawxynh8s5f"))))
ad8aaf47
BD
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)
fad5b1a6 802 ("sqlite" ,sqlite)
ad8aaf47
BD
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
809easily manage desktop fonts, without having to resort to command-line
810tools or editing configuration files by hand.
811While designed primarily with the GNOME Desktop Environment in mind, it should
812work well with other GTK+ desktop environments.")
813 (license license:gpl3+)))
cc51c03f
RJ
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
872samples that show coverage of the font and are similar in appearance to
873Unicode Charts. It was developed for use with DejaVu Fonts project.")
874 (license license:gpl3+)))
a1797f32
NG
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 "/"
67c52503 885 "raqm-" version ".tar.gz"))
a1797f32
NG
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
903layout and provides a convenient API.
904
905It currently provides bidirectional text support (using FriBiDi),
906shaping (using HarfBuzz), and proper script itemization. As a result, Raqm
907can support most writing systems covered by Unicode.")
908 (license license:expat)))