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