projects/guix·blob ruby-team · refs

2407 lines · 93.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Andreas Enge <[email protected]>
3;;; Copyright © 2014, 2016 Eric Bavier <[email protected]>
4;;; Copyright © 2016 Mark H Weaver <[email protected]>
5;;; Copyright © 2016, 2017, 2020, 2022, 2023 Efraim Flashner <[email protected]>
6;;; Copyright © 2017 Rene Saavedra <[email protected]>
7;;; Copyright © 2017 Leo Famulari <[email protected]>
8;;; Copyright © 2017 Nikita <[email protected]>
9;;; Copyright © 2017, 2018, 2020–2022 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018, 2024 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2018-2021, 2023, 2026 Ludovic Courtès <[email protected]>
12;;; Copyright © 2019, 2020, 2022 Marius Bakke <[email protected]>
13;;; Copyright © 2020 Roel Janssen <[email protected]>
14;;; Copyright © 2020, 2021, 2024 Nicolas Goaziou <[email protected]>
15;;; Copyright © 2021-2026 Maxim Cournoyer <[email protected]>
16;;; Copyright © 2021 Sarah Morgensen <[email protected]>
17;;; Copyright © 2022 Eric Bavier <[email protected]>
18;;; Copyright © 2022 Felipe Balbi <[email protected]>
19;;; Copyright © 2023 gemmaro <[email protected]>
20;;; Copyright © 2023 John Kehayias <[email protected]>
21;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
22;;; Copyright © 2023, 2025 pinoaffe <[email protected]>
23;;; Copyright © 2023 Liliana Marie Prikler <[email protected]>
24;;; Copyright © 2024 Sören Tempel <[email protected]>
25;;; Copyright © 2023 Zheng Junjie <[email protected]>
26;;; Copyright © 2024 Sou Bunnbu (宋文武) <[email protected]>
27;;; Copyright © 2025, 2026 Ashish SHUKLA <[email protected]>
28;;; Copyright © 2025 Alexey Abramov <[email protected]>
29;;;
30;;; This file is part of GNU Guix.
31;;;
32;;; GNU Guix is free software; you can redistribute it and/or modify it
33;;; under the terms of the GNU General Public License as published by
34;;; the Free Software Foundation; either version 3 of the License, or (at
35;;; your option) any later version.
36;;;
37;;; GNU Guix is distributed in the hope that it will be useful, but
38;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40;;; GNU General Public License for more details.
41;;;
42;;; You should have received a copy of the GNU General Public License
43;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45(define-module (gnu packages fontutils)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages bash)
49 #:use-module (gnu packages bison)
50 #:use-module (gnu packages build-tools)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages datastructures)
54 #:use-module (gnu packages docbook)
55 #:use-module (gnu packages compiler-tools)
56 #:use-module (gnu packages fonts)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages fribidi)
59 #:use-module (gnu packages gcc)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages ghostscript)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages golang-xyz)
65 #:use-module (gnu packages gperf)
66 #:use-module (gnu packages graphics)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages java)
70 #:use-module (gnu packages linux)
71 #:use-module (gnu packages man)
72 #:use-module (gnu packages mc)
73 #:use-module (gnu packages perl)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages python)
76 #:use-module (gnu packages python-build)
77 #:use-module (gnu packages python-xyz)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages sqlite)
80 #:use-module (gnu packages unicode)
81 #:use-module (gnu packages webkit)
82 #:use-module (gnu packages xdisorg)
83 #:use-module (gnu packages xml)
84 #:use-module (gnu packages xorg)
85 #:use-module (gnu packages tex)
86 #:use-module (gnu packages textutils)
87 #:use-module ((guix licenses) #:prefix license:)
88 #:use-module (guix gexp)
89 #:use-module (guix packages)
90 #:use-module (guix download)
91 #:use-module (guix svn-download)
92 #:use-module (guix git-download)
93 #:use-module (guix build-system copy)
94 #:use-module (guix build-system cmake)
95 #:use-module (guix build-system gnu)
96 #:use-module (guix build-system go)
97 #:use-module (guix build-system meson)
98 #:use-module (guix build-system pyproject)
99 #:use-module (guix utils)
100 #:use-module (srfi srfi-1))
101
102(define-public freetype
103 (package
104 (name "freetype")
105 (version "2.13.3")
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "mirror://savannah/freetype/freetype-"
110 version ".tar.xz"))
111 (sha256
112 (base32 "129j0rprq6iijmckjmk9yyjwnfimpg3mlpdqmr6wf9ylcq33al05"))))
113 (build-system gnu-build-system)
114 (arguments
115 ;; The use of "freetype-config" is deprecated, but other packages still
116 ;; depend on it.
117 (list
118 #:configure-flags #~(list "--enable-freetype-config"
119 ;; armhf-linux: Disable SLP vectorization.
120 ;; gcc-14 optimization bug that breaks
121 ;; ghostscript PostScript font handling (fixed
122 ;; in gcc-15). See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119155
123 #$@(if (target-arm32?)
124 (list "CFLAGS=-g -O2 -fno-tree-slp-vectorize")
125 '()))
126 #:disallowed-references (list (this-package-native-input
127 (if (%current-target-system)
128 (string-append "pkg-config-"
129 (%current-target-system))
130 "pkg-config")))
131 #:phases
132 #~(modify-phases %standard-phases
133 (add-after 'install 'remove-reference-to-pkg-config
134 (lambda* (#:key outputs #:allow-other-keys)
135 (substitute* (search-input-file outputs "bin/freetype-config")
136 (("/([a-zA-Z0-9/\\._-]+)/bin/([a-zA-Z0-9_-]+)?pkg-config"
137 _ store target)
138 "pkg-config")))))))
139 (native-inputs (list pkg-config))
140 ;; XXX: Not adding harfbuzz here, as it would introduce a dependency
141 ;; cycle.
142 (propagated-inputs (list libpng zlib))
143 (synopsis "Font rendering library")
144 (description
145 "Freetype is a library that can be used by applications to access the
146contents of font files. It provides a uniform interface to access font files.
147It supports both bitmap and scalable formats, including TrueType, OpenType,
148Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
149anti-aliased glyph bitmap generation with 256 gray levels.")
150 (license license:freetype) ; some files have other licenses
151 (home-page "https://freetype.org/")))
152
153;; TODO: Make this change directly in freetype in the next large rebuild cycle
154;; and remove this package.
155(define-public freetype-with-brotli
156 (package
157 (inherit freetype)
158 (name "freetype-with-brotli")
159 (propagated-inputs
160 (modify-inputs propagated-inputs
161 (prepend brotli)))))
162
163(define-public opentype-sanitizer
164 (package
165 (name "opentype-sanitizer")
166 (version "8.2.1")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "https://github.com/khaledhosny/ots"
170 "/releases/download/v" version
171 "/ots-" version ".tar.xz"))
172 (sha256
173 (base32
174 "17z8cxv48rfig5k7j3xk3bmbf7rm3kxsc3bazix96l0wws58r569"))))
175 (build-system meson-build-system)
176 (native-inputs (list googletest-1.12 pkg-config))
177 (inputs (list freetype lz4 woff2 zlib))
178 (home-page "https://github.com/khaledhosny/ots")
179 (synopsis "Sanitizer for OpenType fonts")
180 (description "The OpenType Sanitizer (OTS) parses and serializes OpenType
181files (OTF, TTF) and WOFF and WOFF2 font files, validating them and sanitizing
182them as it goes.")
183 (license license:bsd-3)))
184
185(define-public python-afdko
186 (package
187 (name "python-afdko")
188 (version "4.0.2")
189 (source
190 (origin
191 (method url-fetch)
192 (uri (pypi-uri "afdko" version))
193 (sha256
194 (base32 "0c6ribidsmcd9rihy32gknfrr3iw8dy2jlmq6lk05pc33s3ix8z1"))
195 (modules '((guix build utils)))
196 (snippet
197 #~(begin
198 (with-directory-excursion "c/makeotf/lib/hotconv"
199 ;; Delete ANTLR-generated code.
200 (for-each delete-file
201 (find-files
202 "." "Feat(Parser|Lexer).*\\.(h|cpp|interp|tokens)$")))))))
203 (build-system pyproject-build-system)
204 (arguments
205 (list
206 #:test-flags
207 #~(list
208 "--dist" "loadfile" "-n"
209 (number->string (parallel-job-count))
210 "-k" (string-join
211 ;; This test fails because of a different date
212 ;; in the copyright header of an expected file
213 ;; since an update to ffmpeg.
214 '("not test_alt_missing_glyph"
215 ;; AssertionError: assert False
216 "test_build_font_and_check_messages"
217 "test_duplicate_warning_messages_bug751"
218 "test_cli_numerics"
219 ;; The test_decimals_ufo and
220 ;; test_type1_supported_hint started failing in
221 ;; 4.0.2, due to small variations compared to the
222 ;; expected output, likely caused by our newer
223 ;; python-fonttools (see:
224 ;; <https://github.com/adobe-type-tools/afdko/issues/1805>).
225 "test_decimals_ufo"
226 "test_type1_supported_hint")
227 " and not "))
228 #:phases
229 #~(modify-phases %standard-phases
230 (add-after 'unpack 'use-c++17
231 (lambda _
232 ;; ANTLR4 4.10 and later require C++ 17.
233 (substitute* "CMakeLists.txt"
234 (("CMAKE_CXX_STANDARD 11")
235 "CMAKE_CXX_STANDARD 17"))))
236 (add-after 'unpack 'patch-problematic-requirements
237 (lambda _
238 (substitute* "requirements.txt"
239 ;; Remove lxml because the version requested here is different
240 ;; than the one propagated by the python-fonttools package.
241 (("^lxml==.*") "")
242 (("<=4.38.0") ">=4.38.0"))))
243 (add-after 'unpack 'patch-setup.py
244 (lambda _
245 ;; There is no use for Python-provided CMake nor Ninja binaries.
246 (substitute* '("pyproject.toml" "setup.py")
247 ((".*cmake.*") "")
248 ((".*ninja.*") ""))))
249 (add-after 'unpack 'unbundle-antlr4-cpp
250 (lambda* (#:key inputs #:allow-other-keys)
251 (substitute* "CMakeLists.txt"
252 (("^include\\(ExternalAntlr4Cpp).*")
253 (format #f "include_directories(SYSTEM ~a)"
254 (search-input-directory inputs
255 "include/antlr4-runtime"))))
256 (substitute* '("c/makeotf/lib/hotconv/CMakeLists.txt"
257 "c/makeotf/lib/cffread/CMakeLists.txt")
258 (("antlr4_static")
259 "antlr4-runtime"))))
260 (add-after 'unpack 'regenerate-hotconv-grammar
261 (lambda _
262 (let ((antlr-version #$(package-version
263 (this-package-native-input "antlr4"))))
264 (with-directory-excursion "c/makeotf/lib/hotconv"
265 (substitute* "BuildGrammar.py"
266 (("antlr_version = .*")
267 (string-append "antlr_version = \""
268 antlr-version
269 "\"")))
270 (invoke "python" "BuildGrammar.py")))))
271 (add-before 'build 'relax-gcc-warnings
272 (lambda _
273 ;; Relax a warning turned error with GCC 14.
274 (setenv "CFLAGS" (string-join
275 (list "-g" "-O2"
276 "-Wno-error=incompatible-pointer-types"
277 "-Wno-error=int-conversion")
278 " "))))
279 ;; The test suite expects the commands to be Python rather than
280 ;; shell scripts, so move the wrap phase after the tests.
281 (delete 'wrap)
282 (add-after 'check 'wrap
283 (assoc-ref %standard-phases 'wrap))
284 (add-before 'wrap 'wrap-PATH
285 (lambda _
286 ;; The commands execute other commands from this package from
287 ;; PATH; by wrapping them with bindir, they can be found even
288 ;; when the command is run from its store location.
289 (let* ((bindir (string-append #$output "/bin"))
290 (commands (find-files bindir)))
291 (for-each (lambda (c)
292 (wrap-program c
293 `("PATH" prefix (,bindir))))
294 commands)))))))
295 (native-inputs
296 (list antlr4
297 ninja
298 pkg-config
299 python-pytest
300 python-pytest-xdist
301 python-scikit-build
302 python-setuptools-scm
303 python-wheel))
304 (inputs
305 (list bash-minimal
306 cpp-antlr4-runtime
307 libxml2
308 `(,util-linux "lib")))
309 (propagated-inputs
310 (list psautohint
311 python-booleanoperations
312 python-defcon
313 python-fontmath
314 python-fonttools
315 python-lxml
316 python-tqdm
317 python-ufonormalizer
318 python-ufoprocessor))
319 (home-page "https://github.com/adobe-type-tools/afdko")
320 (synopsis "Adobe Font Development Kit for OpenType")
321 (description "The Adobe Font Development Kit for OpenType (AFDKO) is a set
322of tools for building OpenType font (OTF) files from PostScript and TrueType
323font data. It includes the following commands:
324@table @command
325@item buildcff2vf
326Assemble a CFF2 variable font from a .designspace file.
327@item buildmasterotfs
328Build master source OpenType/CFF fonts from a @file{.designspace} file
329and UFO master source fonts.
330@item charplot
331@itemx digiplot
332@itemx fontplot
333@itemx fontsetplot
334@itemx hintplot
335@itemx waterfallplot
336Aliases for the corresponding options of the @command{proofpdf} command.
337@item checkoutlinesufo
338Perform outline quality checks. It can also remove path overlaps.
339@item comparefamily
340Look in a specific directory, examine and report on all the OpenType fonts found.
341@item type1
342@itemx detype1
343Compile and decompile, respectively, a Type 1 font to and from a plain-text
344representation.
345@item makeinstancesufo
346Generate UFO font instances from a set of master UFO fonts.
347@item makeotfexe
348Read all the font data and build the final OpenType font.
349@item makeotf
350This command can be used to prepare the input files needed by
351@command{makeotfexe}.
352@item mergefonts
353Merge one or more fonts into a parent font.
354@item otc2otf
355Extract all OpenType fonts from the parent OpenType Collection font.
356@item otf2otc
357Build an OpenType Collection font file from two or more OpenType font
358files.
359@item otf2ttf
360Converts OpenType-CFF fonts to TrueType.
361@item rotatefont
362Apply a Postscript transform matrix to the source font files.
363@item sfntdiff
364Low-level comparison of two OpenType font files.
365@item sfntedit
366Support table-editing, listing, and checksumming options on
367sfnt-formatted files such as OpenType Format (OTF) or TrueType.
368@item spot
369Dump sfnt data from plain files or Macintosh resource files.
370@item ttfcomponentizer
371Take in a TrueType font and look for a UFO font stored in the same directory.
372Use the UFO's components data to compose matching TrueType glyphs.
373@item ttfdecomponentizer
374Take in a TrueType font and decompose any composite glyphs into simple glyphs.
375@item ttxn
376Make a normalized dump of the font, or of selected tables.
377@item tx
378The @command{tx} (Type eXchange) is a test harness for the CoreType libraries
379but also provides many useful font conversion and analysis facilities.
380@end table")
381 (license license:asl2.0)))
382
383(define-public python-afdko-3.6.1
384 ;; This older version does not depend on Java and Antlr4.
385 (package
386 (inherit python-afdko)
387 (version "3.6.1")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (pypi-uri "afdko" version))
392 (sha256
393 (base32 "0187xhgw6spzaji93fs1mnhqnq30pxhdj1p2m88673szvzpf10av"))))
394 (arguments
395 (list
396 #:phases
397 #~(modify-phases %standard-phases
398 (add-after 'unpack 'relax-gcc14-strictness
399 (lambda _
400 (substitute* (string-append
401 "c/makeotf/makeotf_lib/build"
402 "/hotconv/linux/gcc/release/Makefile")
403 (("CFLAGS = ")
404 "CFLAGS = -Wno-error=int-conversion"))
405 (substitute*
406 "c/public/lib/build/t1write/linux/gcc/release/Makefile"
407 (("CFLAGS = ")
408 "CFLAGS = -Wno-error=incompatible-pointer-types"))))
409 (add-before 'build 'set-CC
410 (lambda _
411 (setenv "CC" "gcc")))
412 (replace 'check
413 ;; tests: 646 passed, 4 skipped, 40 warnings
414 ;; TODO: Try to fix more tests if this package is still required.
415 (lambda* (#:key tests? #:allow-other-keys)
416 (when tests?
417 (setenv "HOME" "/tmp")
418 (invoke "pytest" "-vv"
419 "-n" (number->string (min 8 (parallel-job-count)))
420 "--ignore=tests/buildcff2vf_test.py"
421 "--ignore=tests/comparefamily_test.py"
422 "--ignore=tests/makeinstancesufo_test.py"
423 "--ignore=tests/makeotf_test.py"
424 "--ignore=tests/makeotfexe_test.py"
425 "--ignore=tests/otc2otf_test.py"
426 "--ignore=tests/otf2ttf_test.py"
427 "--ignore=tests/proofpdf_test.py"
428 "--ignore=tests/ttxn_test.py")))))))
429 (native-inputs
430 (list pkg-config
431 python-pytest
432 python-pytest-xdist
433 python-setuptools-scm
434 python-wheel))
435 (inputs
436 (list bash-minimal
437 libxml2))
438 (propagated-inputs
439 (list psautohint
440 python-booleanoperations
441 python-defcon
442 python-fontmath
443 python-fonttools
444 python-lxml
445 python-tqdm
446 python-ufonormalizer
447 python-ufoprocessor))))
448
449(define-public python-beziers
450 (package
451 (name "python-beziers")
452 (version "0.6.0")
453 (source
454 (origin
455 (method git-fetch)
456 (uri (git-reference
457 (url "https://github.com/simoncozens/beziers.py")
458 (commit (string-append "v" version))))
459 (file-name (git-file-name name version))
460 (sha256
461 (base32 "1ww2cc4wi3a3i9wknddjcii2p4r8ksilkqpnbkqg6d7z3jqrcf9n"))))
462 (build-system pyproject-build-system)
463 (native-inputs
464 (list python-pytest python-dotmap python-matplotlib python-setuptools))
465 (propagated-inputs (list python-pyclipper))
466 (home-page "https://simoncozens.github.io/beziers.py/index.html")
467 (synopsis "Python bezier manipulation library")
468 (description
469 "Beziers provides a variety of classes for constructing,
470manipulating and drawing Bezier curves and paths. Principally designed for
471font design software, it allows you to join, split, offset, and perform many
472other operations on paths.")
473 (license license:expat)))
474
475(define-public python-booleanoperations
476 (package
477 (name "python-booleanoperations")
478 (version "0.9.0")
479 (source
480 (origin
481 (method git-fetch)
482 (uri (git-reference
483 (url "https://github.com/typemytype/booleanOperations")
484 (commit version)))
485 (file-name (git-file-name name version))
486 (sha256
487 (base32 "0ahfgamyq1ndwbr9n8sdx8qhqc2195xnbahylgjpk877hbr2gxav"))))
488 (build-system pyproject-build-system)
489 (arguments
490 (list
491 ;; Some tests fail due to small differences in the expected result (see:
492 ;; <https://github.com/typemytype/booleanOperations/issues/69>).
493 #:test-flags
494 #~(list "-k"
495 (string-join
496 (list "not test_QTail_reversed_difference"
497 "test_QTail_reversed_intersection"
498 "test_QTail_reversed_union"
499 "test_QTail_reversed_xor"
500 "test_Q_difference"
501 "test_Q_intersection"
502 "test_Q_union"
503 "test_Q_xor")
504 " and not "))))
505 (native-inputs
506 (list python-defcon-bootstrap
507 python-fontpens-bootstrap
508 python-pytest
509 python-setuptools
510 python-setuptools-scm))
511 (propagated-inputs
512 (list python-fonttools-minimal
513 python-pyclipper))
514 (home-page "https://github.com/typemytype/booleanOperations")
515 (synopsis "Boolean operations on paths")
516 (description
517 "Boolean operations on paths which uses a super fast
518@url{http://www.angusj.com/delphi/clipper.php, polygon clipper library by
519Angus Johnson}.")
520 (license license:expat)))
521
522(define-public python-cffsubr
523 (package
524 (name "python-cffsubr")
525 (version "0.3.0")
526 (source
527 (origin
528 (method url-fetch)
529 (uri (pypi-uri "cffsubr" version))
530 (modules '((guix build utils)))
531 (snippet '(delete-file-recursively "external")) ;unbundle ADFKO
532 (sha256
533 (base32 "1yrfjn3mdi48pg78yzlmskdz9i4nf2wg7h8ivnn9yrw1vc5iaibp"))))
534 (build-system pyproject-build-system)
535 (arguments
536 (list
537 #:phases
538 #~(modify-phases %standard-phases
539 (add-after 'unpack 'patch-setup.py
540 (lambda _
541 (substitute* '("pyproject.toml"
542 "setup.py")
543 ;; This is not needed when building the package.
544 (("setuptools-git-ls-files") "")
545 ;; Do not attempt to build the unbundled ADFKO.
546 (("cmdclass\\[\"build_ext\"] = ExecutableBuildExt.*")
547 ""))))
548 (add-after 'unpack 'patch-tx-path
549 (lambda* (#:key inputs #:allow-other-keys)
550 (define tx (search-input-file inputs "bin/tx"))
551 (substitute* "src/cffsubr/__init__.py"
552 (("TX_EXE = \"tx\"")
553 (format #f "TX_EXE = ~s" tx))
554 ;; Use the full 'tx' file name directly.
555 (("with path\\(__name__, TX_EXE) as tx_cli:")
556 "")
557 ((" (return subprocess.run\\(\\[)str\\(tx_cli)(].*)" _ h t)
558 (format #f "~a~s~a" h tx t))))))))
559 (native-inputs
560 (list python-pytest python-setuptools-scm python-setuptools))
561
562 ;; Use version 3.6.1, which matches the bundled version and does not
563 ;; depend on Java.
564 (inputs (list python-afdko-3.6.1))
565
566 (propagated-inputs (list python-fonttools-minimal))
567 (home-page "https://github.com/adobe-type-tools/cffsubr")
568 (synopsis "Compact Font Format (CFF) subroutinizer")
569 (description "This package provides the @command{cffsubr} command, a
570Compact Font Format (CFF) subroutinizer based on the Adobe Font Development
571Kit for OpenType (AFDKO) @command{tx} tool.")
572 (license license:asl2.0)))
573
574(define-public python-compreffor
575 (package
576 (name "python-compreffor")
577 (version "0.5.6")
578 (source
579 (origin
580 (method git-fetch)
581 (uri (git-reference
582 (url "https://github.com/googlefonts/compreffor")
583 (commit version)))
584 (file-name (git-file-name name version))
585 (sha256
586 (base32 "04pgh1ajglvzm229c4janazfillh9156i4zrkhkyn2mb3dm1zq6y"))))
587 (build-system pyproject-build-system)
588 (arguments
589 (list
590 #:test-flags #~(list "--pyargs" "compreffor")))
591 (native-inputs
592 (list python-cython
593 python-pytest
594 python-setuptools
595 python-setuptools-scm))
596 (propagated-inputs (list python-fonttools-minimal))
597 (home-page "https://github.com/googlefonts/compreffor")
598 (synopsis "@acronym{CFF, Compact Font Format} subroutinizer for fontTools")
599 (description
600 "This package provides a @acronym{CFF, Compact Font Format} subroutinizer
601for fontTools.")
602 (license license:asl2.0)))
603
604(define-public python-cu2qu
605 (package
606 (name "python-cu2qu")
607 (version "1.6.7.post2")
608 (source
609 (origin
610 (method url-fetch)
611 (uri (pypi-uri "cu2qu" version ".zip"))
612 (sha256
613 (base32 "022qpzbpi6j56wqz48rnqs6dvksipw13fi4g10k941fnkgcn5x8x"))))
614 (build-system pyproject-build-system)
615 (arguments
616 ;; XXX: Try to remove it when updating python-fonttools.
617 (list #:test-flags #~(list "-k" "not test_ignore_single_points")))
618 (propagated-inputs (list python-fonttools))
619 (native-inputs
620 (list python-cython
621 python-defcon
622 python-pytest
623 python-setuptools
624 python-setuptools-scm
625 python-wheel
626 unzip))
627 (home-page "https://github.com/googlefonts/cu2qu")
628 (synopsis "Cubic-to-quadratic bezier curve conversion")
629 (description "This library provides functions which take in @acronym{UFO,
630Unified Font Object} objects (such as Defcon Fonts or Robofab RFonts) and
631converts any cubic curves to quadratic. The most useful function is probably
632@code{fonts_to_quadratic}.")
633 (license license:asl2.0)))
634
635(define-public python-ufo2ft
636 (package
637 (name "python-ufo2ft")
638 (version "2.33.4")
639 (source
640 (origin
641 (method url-fetch)
642 (uri (pypi-uri "ufo2ft" version))
643 (sha256
644 (base32 "0xnnwlj3rl0p7q19l6wdrfkzzq1f2l5vyl2qs7kl4vvfalgpzakv"))))
645 (build-system pyproject-build-system)
646 (arguments
647 (list #:test-flags
648 #~(list "-k"
649 ;; XXX: These tests all fail with "TTX output is different
650 ;; from expected". Potentially fixed in 3.x release.
651 (string-append "not test_compileVariableTTF "
652 "and not test_compileVariableCFF2 "
653 "and not test_drop_glyph_names_variable "
654 "and not test_buildTables_FeatureLibError "
655 "and not test_kern_zyyy_zinh"))))
656 (native-inputs
657 (list python-pytest
658 python-setuptools-scm
659 python-setuptools
660 python-wheel))
661 (propagated-inputs
662 (list python-booleanoperations
663 python-cffsubr
664 python-compreffor
665 python-cu2qu
666 python-defcon
667 python-fonttools
668 python-skia-pathops
669 python-ufolib2))
670 (home-page "https://github.com/googlefonts/ufo2ft")
671 (synopsis "Generate OpenType fonts from Unified Font Objects (UFOs)")
672 (description "@code{ufo2ft} (UFO to FontTools) is a fork of @code{ufo2fdk}
673intended to leverage FontTools (a Python library) rather than the Adobe Font
674Development Kit for OpenType (AFDKO), a set of C libraries/utilities so that
675it can be more easily extended. Like @code{ufo2fdk}, its primary purpose is
676to generate OpenType font binaries from Unified Font Objects (UFOs).")
677 (license license:expat)))
678
679(define-public python-fontmath
680 (package
681 (name "python-fontmath")
682 (version "0.9.4")
683 (source
684 (origin
685 (method git-fetch)
686 (uri (git-reference
687 (url "https://github.com/robotools/fontMath")
688 (commit version)))
689 (file-name (git-file-name name version))
690 (sha256
691 (base32 "0g8vpwn4flg0rj7ar8wl9xlpjhcgiz01p56fzkjdlf2jqb36akyy"))))
692 (build-system pyproject-build-system)
693 (propagated-inputs (list python-fonttools-minimal))
694 (native-inputs
695 (list python-pytest
696 python-setuptools
697 python-setuptools-scm
698 unzip))
699 (home-page "https://github.com/robotools/fontMath")
700 (synopsis "Fast font mathematical operations library")
701 (description "This package provides a set of objects for performing fast
702font, glyph, etc. mathematical operations on font data.")
703 (license license:expat)))
704
705;;; An untested variant used to break a cycle with python-booleanoperations.
706(define-public python-fontpens-bootstrap
707 (package
708 (name "python-fontpens-bootstrap")
709 (version "0.2.4")
710 (source
711 (origin
712 (method url-fetch)
713 (uri (pypi-uri "fontPens" version ".zip"))
714 (sha256
715 (base32 "1za15dzsnymq6d9x7xdfqwgw4a3003wj75fn2crhyidkfd2s3nd6"))))
716 (build-system pyproject-build-system)
717 (arguments (list #:tests? #f))
718 (propagated-inputs (list python-fonttools-minimal))
719 (native-inputs (list python-setuptools unzip))
720 (home-page "https://github.com/robofab-developers/fontPens")
721 (synopsis "Python classes implementing the pen protocol")
722 (description "This package provides a collection of Python classes
723implementing the pen protocol for manipulating glyphs.")
724 (license license:bsd-3)))
725
726(define-public python-fontpens
727 (hidden-package
728 (package/inherit python-fontpens-bootstrap
729 (name "python-fontpens")
730 (arguments
731 (substitute-keyword-arguments arguments
732 ((#:tests? _ #f)
733 #t)
734 ((#:phases phases #~%standard-phases)
735 #~(modify-phases #$phases
736 (add-after 'unpack 'drop-flaky-docstring
737 ;; XXX This assertion fails on certain (Intel?) machines, but not
738 ;; others (AMD?), so we can't patch in a ‘correct’ value. Just
739 ;; drop it until the proper fix lands upstream. Reported there
740 ;; as <https://github.com/robotools/fontPens/issues/41>.
741 (lambda _
742 (substitute* "Lib/fontPens/penTools.py"
743 ((".*\\(\\(0, 0), \\(50, 20), \\(100, 40)).*") "")
744 ((".*107\\.70329614269009.*") ""))))))))
745 (native-inputs
746 (modify-inputs native-inputs
747 (append python-fontparts-bootstrap
748 python-fontpens-bootstrap
749 python-pytest))))))
750
751;;; A variant used to break a cycle with python-fontpens.
752(define-public python-fontparts-bootstrap
753 (hidden-package
754 (package
755 (name "python-fontparts-bootstrap")
756 (version "0.13.3")
757 (source
758 (origin
759 (method url-fetch)
760 (uri (pypi-uri "fontparts" version ".tar.gz"))
761 (sha256
762 (base32 "0ddyfa975hskaip6l4hn7n2jh50y5s0pw911phyx2fsws54pw5s7"))))
763 (build-system pyproject-build-system)
764 (arguments
765 (list #:test-backend #~'custom
766 #:test-flags #~(list "Lib/fontParts/fontshell/test.py")))
767 (propagated-inputs
768 (list python-booleanoperations
769 python-defcon-bootstrap
770 python-fontmath
771 python-fonttools-minimal))
772 (native-inputs
773 (list python-setuptools
774 python-setuptools-scm))
775 (home-page "https://github.com/robotools/fontParts")
776 (synopsis "Library for interacting with font parts")
777 (description "FontParts is an @acronym{API, Application Programming
778Interface} for interacting with the parts of fonts during the font development
779process. FontParts is the successor of RoboFab.")
780 (license license:expat))))
781
782(define-public python-fontparts
783 (package/inherit python-fontparts-bootstrap
784 (name "python-fontparts")
785 (propagated-inputs
786 (modify-inputs propagated-inputs
787 (replace "python-defcon-bootstrap" python-defcon)))
788 (properties
789 (alist-delete 'hidden?
790 (package-properties python-fontparts-bootstrap)))))
791
792(define-public python-freetype-py
793 (package
794 (name "python-freetype-py")
795 (version "2.5.1")
796 (source
797 (origin
798 (method git-fetch) ;no tests in PyPI archive
799 (uri (git-reference
800 (url "https://github.com/rougier/freetype-py")
801 (commit (string-append "v" version))))
802 (file-name (git-file-name name version))
803 (sha256
804 (base32 "0cls0469zfqzwpq6k4pxa9vrczsqabqk4qh7444xybcyq9qgs1lp"))))
805 (build-system pyproject-build-system)
806 (arguments
807 (list
808 #:test-flags #~(list "tests")
809 #:phases
810 #~(modify-phases %standard-phases
811 (add-after 'unpack 'patch-lib-paths
812 (lambda _
813 (substitute* "freetype/raw.py"
814 (("ctypes.util.find_library\\('freetype'\\)")
815 (format #f "'~a/~a'" #$(this-package-input "freetype")
816 "lib/libfreetype.so"))))))))
817 (native-inputs
818 (list python-pytest
819 python-setuptools
820 python-setuptools-scm))
821 (inputs
822 (list freetype))
823 (home-page "https://github.com/rougier/freetype-py")
824 (synopsis "Freetype python bindings")
825 (description
826 "Freetype Python provides bindings for the FreeType library. Only the
827high-level API is bound.")
828 (license license:bsd-3)))
829
830(define-public python-glyphslib
831 (package
832 (name "python-glyphslib")
833 (version "6.6.1") ;6.6.1 is the last version that works with ufo2ft 2.x
834 (source (origin
835 (method git-fetch)
836 (uri (git-reference
837 (url "https://github.com/googlefonts/glyphsLib")
838 (commit (string-append "v" version))))
839 (file-name (git-file-name name version))
840 (sha256
841 (base32
842 "193h5ixq9p9m2kwz8srfw61rzgqg6gishlndqm759cymwax0cibi"))))
843 (build-system pyproject-build-system)
844 (native-inputs
845 (list python-setuptools-scm
846 python-setuptools
847 ;; For tests.
848 python-pytest
849 python-xmldiff))
850 (propagated-inputs
851 (list python-defcon
852 python-fonttools
853 python-openstep-plist
854 python-ufolib2
855 python-ufo2ft
856 python-ufonormalizer))
857 (home-page "https://github.com/googlefonts/glyphsLib")
858 (synopsis "Bridge Glyphs source files to UFOs")
859 (description
860 "This package provides a bridge from Glyphs source files (@file{.glyphs})
861to UFOs and DesignSpace files via @code{defcon} and @code{designspaceLib}.")
862 (license license:asl2.0)))
863
864(define-public python-glyphsets
865 (package
866 (name "python-glyphsets")
867 (version "0.5.2")
868 (source
869 (origin
870 (method url-fetch)
871 (uri (pypi-uri "glyphsets" version))
872 (sha256
873 (base32 "1dc24i0hkd85gkkg3bqjhagjyw3xsqxazd86yh2l60c1wr5n9y6g"))))
874 (build-system pyproject-build-system)
875 (arguments
876 (list
877 #:phases
878 #~(modify-phases %standard-phases
879 (add-after 'unpack 'loosen-version-constraints
880 (lambda _
881 (substitute* "setup.py"
882 (("setuptools_scm>=4,<6\\.1")
883 "setuptools_scm>=4"))))
884 (replace 'check
885 (lambda* (#:key tests? #:allow-other-keys)
886 (when tests?
887 (invoke "pytest" "-vv" "tests/testglyphdata.py")
888 (invoke "pytest" "-vv" "tests/testusage.py")))))))
889 (native-inputs (list python-pytest python-setuptools-scm python-setuptools))
890 (propagated-inputs
891 (list python-defcon python-fonttools-minimal python-glyphslib))
892 (home-page "https://github.com/googlefonts/glyphsets/")
893 (synopsis "Evaluate coverage of glyph sets")
894 (description
895 "This package provides an API with data about glyph sets for many
896different scripts and languages.")
897 (license license:asl2.0)))
898
899(define-public python-opentype-sanitizer
900 (package
901 (name "python-opentype-sanitizer")
902 (version "9.2.0")
903 (source
904 (origin
905 (method git-fetch)
906 (uri (git-reference
907 (url "https://github.com/googlefonts/ots-python")
908 (commit (string-append "v" version))))
909 (file-name (git-file-name name version))
910 (sha256
911 (base32 "0ffk99vcwmwpy2wzky1b0vj5j0i9xw67mwk81dzj696f6sws1dkm"))))
912 (build-system pyproject-build-system)
913 (arguments
914 (list
915 #:phases
916 #~(modify-phases %standard-phases
917 (add-after 'unpack 'unbundle-opentype-sanitizer
918 (lambda* (#:key inputs #:allow-other-keys)
919 (substitute* "setup.py"
920 (("^cmdclass\\[\"(download|build_ext|egg_info)\"].*")
921 ""))
922 (substitute* "src/python/ots/__init__.py"
923 (("^OTS_SANITIZE = .*")
924 (format #f "OTS_SANITIZE = ~s~%"
925 (search-input-file inputs "bin/ots-sanitize")))))))))
926 (native-inputs
927 (list python-pytest python-setuptools python-setuptools-scm))
928 (inputs (list opentype-sanitizer))
929 (home-page "https://github.com/googlefonts/ots-python")
930 (synopsis "Python wrapper for OpenType Sanitizer")
931 (description "Python wrapper for the OpenType Sanitizer library.")
932 (license license:bsd-3)))
933
934(define-public python-mutatormath
935 (package
936 (name "python-mutatormath")
937 (version "3.0.1")
938 (source
939 (origin
940 (method git-fetch)
941 (uri (git-reference
942 (url "https://github.com/LettError/MutatorMath")
943 (commit version)))
944 (file-name (git-file-name name version))
945 (sha256
946 (base32 "1pvkhvafy2zzk8rr2dld866jq000vl2srzh0dw9x5lb6rhxi2f9b"))))
947 (build-system pyproject-build-system)
948 (arguments
949 (list
950 #:test-backend #~'custom
951 #:test-flags #~(list "Lib/mutatorMath/test/run.py")))
952 (propagated-inputs (list python-defcon python-fontmath
953 python-fonttools-minimal))
954 (native-inputs (list python-setuptools unzip))
955 (home-page "https://github.com/LettError/MutatorMath")
956 (synopsis "Piecewise linear interpolation Python library")
957 (description
958 "MutatorMath is a Python library for the calculation of piecewise linear
959interpolations in n-dimensions with any number of masters. It was developed
960for interpolating data related to fonts, but if can handle any arithmetic
961object.")
962 (license license:bsd-3)))
963
964(define-public psautohint-font-data
965 ;; There is no release tag, so use the latest commit.
966 (let ((revision "0")
967 (commit "1e4c5061d328105c4dcfcb6fdbc27ec49b3e9d23"))
968 (hidden-package
969 (package
970 (name "psautohint-font-data")
971 (version (git-version "0.0.0" revision commit))
972 (source
973 (origin
974 (method git-fetch)
975 (uri (git-reference
976 (url "https://github.com/adobe-type-tools/psautohint-testdata")
977 (commit commit)))
978 (file-name (git-file-name name version))
979 (sha256
980 (base32
981 "0p7g8mnndzp8zpbj9h6lkvfdpvd74fy10q8wmkagbg2ahbdi1zva"))))
982 (build-system copy-build-system)
983 (home-page "https://github.com/adobe-type-tools/psautohint-testdata")
984 (synopsis "Test font data psautohint")
985 (description "This package contains the font data used by the test
986suite of the @code{psautohint} package.")
987 ;; The bundle contains font data from the Cantarell, Libertinus, Source
988 ;; Code Pro, Source Serif Pro, all available under the same license.
989 (license license:silofl1.1)))))
990
991(define-public psautohint
992 (package
993 (name "psautohint")
994 (version "2.4.0")
995 (source
996 (origin
997 (method url-fetch)
998 (uri (pypi-uri "psautohint" version))
999 (sha256
1000 (base32 "0zzz7hy1kkkjfrrm9ly2di3xv2x1ywdqhbyqy21k670jysldw3nm"))))
1001 (build-system pyproject-build-system)
1002 (arguments
1003 (list
1004 #:test-flags
1005 #~(list "-k"
1006 (string-join
1007 '(;; The CJKSparseVar.subset.hinted.otf test fails with slightly
1008 ;; different output caused by the newer fonttools version used
1009 ;; in Guix.
1010 "not CJKSparseVar.subset.hinted.otf"
1011 ;; These tests fails underministically, See also:
1012 ;; https://github.com/adobe-type-tools/afdko/issues/1678
1013 "not test_hashmap_no_version"
1014 "not test_hashmap_old_version")
1015 " and "))
1016 #:phases
1017 #~(modify-phases %standard-phases
1018 (add-after 'unpack 'copy-font-data
1019 ;; The data is copied as it needs to be writable for the tests.
1020 (lambda _
1021 (copy-recursively
1022 #$(this-package-native-input "psautohint-font-data")
1023 "tests/integration/data")
1024 (for-each make-file-writable
1025 (find-files "tests/integration/data")))))))
1026 (inputs (list python-fonttools))
1027 (native-inputs
1028 (list psautohint-font-data
1029 python-pytest
1030 python-pytest-xdist
1031 python-setuptools-scm
1032 python-setuptools
1033 python-wheel))
1034 (home-page "https://github.com/adobe-type-tools/psautohint")
1035 (synopsis "Adobe's PostScript autohinter")
1036 (description "This package provides the @command{autohinter} command that
1037can be used to hint PostScript fonts. A Python wrapper is also included.")
1038 (license license:asl2.0)))
1039
1040(define-public python-sfdlib
1041 (package
1042 (name "python-sfdlib")
1043 (version "1.2.5")
1044 (source
1045 (origin
1046 (method git-fetch)
1047 (uri (git-reference
1048 (url "https://github.com/aliftype/sfdLib")
1049 (commit (string-append "v" version))))
1050 (file-name (git-file-name name version))
1051 (sha256
1052 (base32 "00vss0pv7y041rqjlbq8si7319w0mzlkp3ckw150mmxzsrx0m58c"))))
1053 (build-system pyproject-build-system)
1054 (arguments (list #:tests? #f)) ; No tests upstream.
1055 (native-inputs (list python-setuptools))
1056 (propagated-inputs (list python-ufolib2))
1057 (home-page "https://github.com/aliftype/sfdLib")
1058 (synopsis "Simple SFD to UFO converter")
1059 (description
1060 "This package provides the @command{sfd2ufo} command, a converter from
1061FontForge’s @acronym{SFD, Spline Font Database} fonts to @acronym{UFO, Unified
1062Font Object} fonts.")
1063 (license license:bsd-3)))
1064
1065(define-public python-skia-pathops
1066 (package
1067 (name "python-skia-pathops")
1068 (version "0.8.0")
1069 (source
1070 (origin
1071 (method url-fetch)
1072 (uri (pypi-uri "skia-pathops" version ".zip"))
1073 (modules '((guix build utils)))
1074 (snippet '(delete-file-recursively "src/cpp")) ;140+ MiB of stuff
1075 (sha256
1076 (base32 "1vlwl1w6sn8c78fsh1w549n3lk9v3v9hcp866vrsdr4byb7g2ani"))))
1077 (build-system pyproject-build-system)
1078 (arguments
1079 (list
1080 #:phases
1081 #~(modify-phases %standard-phases
1082 (add-after 'unpack 'configure-env
1083 (lambda _
1084 (setenv "BUILD_SKIA_FROM_SOURCE" "0")))
1085 (add-after 'unpack 'adjust-c++-language
1086 (lambda _
1087 ;; Our version of Skia requires c++17.
1088 (substitute* "setup.py"
1089 (("-std=c\\+\\+14")
1090 "-std=c++17")))))))
1091 (native-inputs
1092 (list pkg-config
1093 python-cython-0
1094 python-pytest
1095 python-setuptools-scm
1096 unzip))
1097 (inputs (list skia))
1098 (home-page "https://github.com/fonttools/skia-pathops")
1099 (synopsis "Python bindings for the Skia library's Path Ops module")
1100 (description "This package provides Python bindings for the Path Ops
1101module of the Skia library, performing boolean operations on
1102paths (intersection, union, difference, xor).")
1103 (license license:bsd-3)))
1104
1105(define-public python-ufoprocessor
1106 (package
1107 (name "python-ufoprocessor")
1108 (version "1.14.1")
1109 (source
1110 (origin
1111 (method url-fetch)
1112 (uri (pypi-uri "ufoprocessor" version ".tar.gz"))
1113 (sha256
1114 (base32 "009vq25bn0w5nispvyglrrm21qpxvvjc3zfkm0dig54v6p6d6f7x"))))
1115 (build-system pyproject-build-system)
1116 (arguments
1117 (list
1118 #:test-backend #~'custom
1119 #:test-flags #~(list "Tests/tests.py")))
1120 (propagated-inputs
1121 (list python-defcon
1122 python-fontmath
1123 python-fontparts
1124 python-fonttools-minimal
1125 python-mutatormath))
1126 (native-inputs (list python-setuptools python-setuptools-scm))
1127 (home-page "https://github.com/LettError/ufoProcessor")
1128 (synopsis "Process and generate @acronym{UFO, Unified Font Object} files")
1129 (description "This Python package processes and generates instances for
1130@acronym{UFO, Unified Font Object} files, glyphs and other data. It can,
1131among other things:
1132@itemize
1133@item Collect source materials.
1134@item Provide mutators for specific glyphs, font info, kerning so that other
1135tools can generate partial instances.
1136@item Support designspace format 4 with layers.
1137@item Apply avar-like designspace bending.
1138@item Apply rules.
1139@item Generate actual UFO instances in formats 2 and 3.
1140@item Round geometry as requested.
1141@end itemize")
1142 (license license:expat)))
1143
1144(define-public python-ufonormalizer
1145 (package
1146 (name "python-ufonormalizer")
1147 (version "0.6.3")
1148 (source
1149 (origin
1150 (method git-fetch)
1151 (uri (git-reference
1152 (url "https://github.com/unified-font-object/ufoNormalizer")
1153 (commit version)))
1154 (file-name (git-file-name name version))
1155 (sha256
1156 (base32 "17r72m5gy5fbng3f4vh3z63xjy84q5rdzj5cyvrvwgj33yl6b18k"))))
1157 (build-system pyproject-build-system)
1158 (arguments
1159 (list
1160 #:test-backend #~'unittest))
1161 (native-inputs (list python-setuptools python-setuptools-scm unzip))
1162 (home-page "https://github.com/unified-font-object/ufoNormalizer")
1163 (synopsis "Script to normalize @acronym{UFO, Unified Font Object} data")
1164 (description
1165 "The purpose of the @command{ufonormalizer} command is to provide a
1166standard formatting so that updates to @acronym{UFO, Unified Font Object} data
1167can be usefully versioned. Examples of formatting applied by ufoNormalizer
1168include:
1169@itemize
1170@item Changing floating-point numbers to integers where it doesn't alter the
1171value (e.g. @samp{x=\"95.0\"} becomes @samp{x=\"95\"})
1172@item Rounding floating-point numbers to 10 digits
1173@item Formatting XML with tabs rather than spaces.
1174@end itemize")
1175 (license license:bsd-3)))
1176
1177(define-public fontobene-qt
1178 (package
1179 (name "fontobene-qt")
1180 (version "1.0.0")
1181 (source (origin
1182 (method git-fetch)
1183 (uri (git-reference
1184 (url "https://github.com/fontobene/fontobene-qt")
1185 (commit version)))
1186 (file-name (git-file-name name version))
1187 (sha256
1188 (base32
1189 "098ys33l563hjyzm6azzw8kmlybja374vacakczwhh2k3ifn37r9"))))
1190 (inputs (list qtbase))
1191 (build-system cmake-build-system)
1192 (arguments
1193 `(#:phases
1194 (modify-phases %standard-phases
1195 (replace 'check
1196 (lambda* (#:key tests? #:allow-other-keys)
1197 (when tests?
1198 (invoke "./tests/fontobene-qt-tests")))))))
1199 (home-page "https://github.com/fontobene/fontobene-qt5")
1200 (synopsis "Parser for FontoBene stroke fonts")
1201 (description "FontoBene-Qt is a header-only library to parse FontoBene
1202stroke fonts with C++11/Qt.")
1203 ;; Dual-licensed, either license applies.
1204 (license (list license:asl2.0 license:expat))))
1205
1206(define-public ttfautohint
1207 (package
1208 (name "ttfautohint")
1209 (version "1.8.3")
1210 (source
1211 (origin
1212 (method url-fetch)
1213 (uri (string-append "mirror://savannah/freetype/ttfautohint-"
1214 version ".tar.gz"))
1215 (sha256
1216 (base32
1217 "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7"))))
1218 (build-system gnu-build-system)
1219 (native-inputs
1220 (list flex bison pkg-config))
1221 (inputs
1222 (list freetype harfbuzz))
1223 (arguments
1224 `(#:configure-flags '("--disable-static"
1225 "--with-qt=no"))) ;no gui
1226 (synopsis "Automated font hinting")
1227 (description
1228 "ttfautohint provides a 99% automated hinting process and a platform for
1229finely hand-hinting the last 1%. It is ideal for web fonts and supports many
1230scripts.")
1231 (license (list license:gpl2+ license:freetype)) ;choose one or the other
1232 (home-page "https://www.freetype.org/ttfautohint/")))
1233
1234(define-public woff-tools
1235 (package
1236 (name "woff-tools")
1237 (version "2009.10.04")
1238 (source
1239 (origin
1240 (method url-fetch)
1241 ;; Upstream source is unversioned, so use Debian's versioned tarball
1242 (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
1243 "woff-tools_" version ".orig.tar.gz"))
1244 (file-name (string-append name "-" version ".tar.gz"))
1245 (sha256
1246 (base32
1247 "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
1248 (build-system gnu-build-system)
1249 (inputs
1250 (list zlib))
1251 (arguments
1252 `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
1253 #:tests? #f ;no tests
1254 #:phases
1255 (modify-phases %standard-phases
1256 (delete 'configure) ;no configuration
1257 (replace 'install
1258 (lambda* (#:key outputs #:allow-other-keys)
1259 (let* ((out (assoc-ref outputs "out"))
1260 (bin (string-append out "/bin")))
1261 (install-file "sfnt2woff" bin)
1262 (install-file "woff2sfnt" bin))
1263 #t)))))
1264 (synopsis "Convert between OpenType and WOFF fonts")
1265 (description
1266 "This package provides two tools:
1267@table @code
1268@item sfnt2woff
1269Converts OpenType fonts to WOFF fonts
1270@item woff2sfnt
1271Converts WOFF fonts to OpenType fonts
1272@end table")
1273 (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
1274 (home-page "https://people.mozilla.com/~jkew/woff/")))
1275
1276(define-public ttf2eot
1277 (package
1278 (name "ttf2eot")
1279 (version "0.0.3")
1280 (source
1281 (origin
1282 (method git-fetch)
1283 (uri (git-reference
1284 (url "https://github.com/wget/ttf2eot")
1285 (commit (string-append "v" version))))
1286 (file-name (git-file-name name version))
1287 (sha256
1288 (base32
1289 "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
1290 (patches (list (search-patch "ttf2eot-cstddef.patch")))))
1291 (build-system gnu-build-system)
1292 (arguments
1293 `(#:tests? #f ; no tests
1294 #:phases
1295 (modify-phases %standard-phases
1296 (delete 'configure) ; no configuration
1297 (replace 'install ; no install target
1298 (lambda* (#:key outputs #:allow-other-keys)
1299 (let* ((out (assoc-ref outputs "out"))
1300 (bin (string-append out "/bin")))
1301 (install-file "ttf2eot" bin)
1302 #t))))))
1303 (synopsis "Convert from TrueType to Embeddable Open Type")
1304 (description
1305 "This package contains a commandline wrapper around OpenTypeUtilities.cpp
1306from Chromium, used to make EOT (Embeddable Open Type) files from
1307TTF (TrueType/OpenType Font) files.")
1308 ;; While the README states "License: Derived from WebKit, so BSD/LGPL
1309 ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
1310 ;; license header, and the wrapper source contains no license header.
1311 (license license:bsd-2)
1312 (home-page "https://github.com/wget/ttf2eot")))
1313
1314(define-public ttf2pt1
1315 (package
1316 (name "ttf2pt1")
1317 (version "3.4.4")
1318 (source (origin
1319 (method url-fetch)
1320 (uri (string-append "mirror://sourceforge/ttf2pt1/ttf2pt1/"
1321 version "/ttf2pt1-" version ".tgz"))
1322 (sha256
1323 (base32
1324 "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf"))
1325 (modules '((guix build utils)))
1326 (snippet
1327 #~(begin
1328 ;; Include <unistd.h> for the 'getopt' declaration.
1329 (substitute* "t1asm.c"
1330 (("#include <stdio.h>" all)
1331 (string-append all "\n"
1332 "#include <unistd.h>\n")))
1333
1334 ;; Remove trailing backslashes in the sed expression of the
1335 ;; 'install' rule since sed would otherwise fail.
1336 (substitute* "Makefile"
1337 (("\\|;\\\\[[:space:]]*$") "|; "))
1338 #t))))
1339 (build-system gnu-build-system)
1340 (arguments
1341 (list #:tests? #f ;no tests
1342 #:phases
1343 #~(modify-phases %standard-phases
1344 (replace 'configure
1345 (lambda* (#:key outputs #:allow-other-keys)
1346 (let ((out (assoc-ref outputs "out")))
1347 (substitute* "Makefile"
1348 (("INSTDIR =.*")
1349 (string-append "INSTDIR = " out "\n"))
1350 (("OWNER = .*")
1351 "OWNER = `id -un`\n")
1352 (("GROUP = .*")
1353 "GROUP = `id -g`\n")) #t)))
1354 (replace 'build
1355 (lambda _
1356 (invoke "make" "-j"
1357 (number->string (parallel-job-count))
1358 "all" "CC=gcc"))))))
1359 (inputs (list perl))
1360 (synopsis "Convert TrueType fonts to Postscript Type 1")
1361 (description
1362 "TTF2PT1 provides tools to convert most TrueType fonts (or other formats
1363supported by the FreeType library) to an Adobe Type 1 @file{.pfa} or
1364@file{.pfb} file. Another use is as a hinting engine: feed it an unhinted or
1365poorly hinted Adobe Type 1 font through the FreeType library and get it back
1366with freshly generated hints. The files produced by default are in
1367human-readable form, which further needs to be encoded with t1utilities to
1368work with most software requiring Type 1 fonts.")
1369 (home-page "https://ttf2pt1.sourceforge.net/")
1370 (license license:bsd-3)))
1371
1372(define-public woff2
1373 (package
1374 (name "woff2")
1375 (version "1.0.2")
1376 (source
1377 (origin
1378 (method git-fetch)
1379 (uri
1380 (git-reference
1381 (url "https://github.com/google/woff2")
1382 (commit (string-append "v" version))))
1383 (file-name
1384 (git-file-name name version))
1385 (sha256
1386 (base32 "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
1387 (build-system cmake-build-system)
1388 (outputs '("out" "bin"))
1389 (arguments
1390 `(#:tests? #f ;no test suite
1391 #:configure-flags
1392 (list
1393 (string-append "-DCMAKE_INSTALL_BINDIR="
1394 (assoc-ref %outputs "bin")
1395 "/bin")
1396 (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
1397 (assoc-ref %outputs "out")
1398 "/include")
1399 (string-append "-DCMAKE_INSTALL_LIBDIR="
1400 (assoc-ref %outputs "out")
1401 "/lib"))
1402 #:phases
1403 (modify-phases %standard-phases
1404 ;; To install both binaries and libraries.
1405 (add-after 'unpack 'patch-installation
1406 (lambda _
1407 (substitute* "CMakeLists.txt"
1408 (("NOT BUILD_SHARED_LIBS")
1409 "BUILD_SHARED_LIBS")))))))
1410 (native-inputs
1411 (list pkg-config))
1412 (propagated-inputs
1413 (list brotli)) ;libwoff2dec.pc requires libbrotlidec
1414 (synopsis "Libraries and tools for WOFF2 font format")
1415 (description "WOFF2 provides libraries and tools to handle the Web Open
1416Font Format (WOFF).")
1417 (home-page "https://w3c.github.io/woff/woff2/")
1418 (license license:expat)))
1419
1420;;; Update with: guix refresh -u '(@ (gnu packages fontutils) fontconfig)'
1421(define-public fontconfig
1422 (hidden-package
1423 (package
1424 (name "fontconfig-minimal")
1425 (version "2.17.1")
1426 (source (origin
1427 (method url-fetch)
1428 (uri (string-append
1429 "https://gitlab.freedesktop.org/api/v4/projects/890"
1430 "/packages/generic/fontconfig/" version "/fontconfig-"
1431 version ".tar.xz"))
1432 (sha256 (base32
1433 "0hd5dw15q0i7518w1zqjcvyhvmlcf3ycv6df0ny1zz7zyj9swp4z"))
1434 (patches (search-patches "fontconfig-cache-ignore-mtime.patch"))))
1435 (build-system gnu-build-system)
1436 ;; In Requires or Requires.private of fontconfig.pc.
1437 (propagated-inputs (list expat freetype
1438 `(,util-linux "lib")))
1439 (inputs
1440 ;; We use to use 'font-ghostscript' but they are not recognized by newer
1441 ;; versions of Pango, causing many applications to fail to find fonts
1442 ;; otherwise.
1443 (list font-dejavu))
1444 (native-inputs
1445 (list autoconf-2.71
1446 automake
1447 gettext-minimal
1448 gperf
1449 libtool
1450 pkg-config
1451 python-minimal)) ;to avoid a cycle through tk
1452 (arguments
1453 (list
1454 #:configure-flags
1455 #~(list "--disable-docs"
1456 "--with-cache-dir=/var/cache/fontconfig"
1457 ;; register the default fonts
1458 (string-append "--with-default-fonts="
1459 #$(this-package-input "font-dejavu")
1460 "/share/fonts"))
1461 #:phases
1462 #~(modify-phases %standard-phases
1463 (add-before 'check 'skip-problematic-tests
1464 (lambda _
1465 ;; SOURCE_DATE_EPOCH doesn't make sense when ignoring mtime
1466 (unsetenv "SOURCE_DATE_EPOCH")
1467
1468 (substitute* "test/run-test.sh"
1469 ;; The crbug1004254 test attempts to fetch fonts from the
1470 ;; network.
1471 (("\\[ -x \"\\$BUILDTESTDIR\"/test-crbug1004254 \\]")
1472 "false"))))
1473 (replace 'install
1474 (lambda _
1475 ;; Don't try to create /var/cache/fontconfig.
1476 (invoke "make" "install"
1477 "fc_cachedir=$(TMPDIR)"
1478 "RUN_FC_CACHE_TEST=false"))))))
1479 (synopsis "Library for configuring and customizing font access")
1480 (description
1481 "Fontconfig can discover new fonts when installed automatically;
1482perform font name substitution, so that appropriate alternative fonts can
1483be selected if fonts are missing;
1484identify the set of fonts required to completely cover a set of languages;
1485have GUI configuration tools built as it uses an XML-based configuration file;
1486efficiently and quickly find needed fonts among the set of installed fonts;
1487be used in concert with the X Render Extension and FreeType to implement
1488high quality, anti-aliased and subpixel rendered text on a display.")
1489 ; The exact license is more X11-style than BSD-style.
1490 (license (license:non-copyleft "file://COPYING"
1491 "See COPYING in the distribution."))
1492 (native-search-paths
1493 ;; Since version 2.13.94, fontconfig knows to find fonts from
1494 ;; XDG_DATA_DIRS.
1495 (list (search-path-specification
1496 (variable "XDG_DATA_DIRS")
1497 (files '("share")))))
1498 (home-page "https://www.freedesktop.org/wiki/Software/fontconfig/"))))
1499
1500;;; The documentation of fontconfig is built in a separate package, as it
1501;;; causes a dramatic increase in the size of the closure of fontconfig.
1502(define-public fontconfig-with-documentation
1503 (package
1504 (inherit fontconfig)
1505 (name "fontconfig")
1506 (outputs (cons "doc" (package-outputs fontconfig)))
1507 (arguments
1508 (substitute-keyword-arguments arguments
1509 ((#:configure-flags configure-flags)
1510 #~(delete "--disable-docs" #$configure-flags))
1511 ((#:phases phases '%standard-phases)
1512 #~(modify-phases #$phases
1513 (add-after 'unpack 'no-pdf-doc
1514 (lambda _
1515 ;; Don't build documentation as PDF.
1516 (substitute* "doc/Makefile.in"
1517 (("^PDF_FILES = .*")
1518 "PDF_FILES =\n"))))
1519 (add-after 'install 'move-man-sections
1520 (lambda* (#:key outputs #:allow-other-keys)
1521 ;; Move share/man/man{3,5} to the "doc" output. Leave "man1" in
1522 ;; "out" for convenience.
1523 (for-each
1524 (lambda (section)
1525 (let ((source (string-append #$output "/share/man/"
1526 section))
1527 (target (string-append #$output:doc "/share/man/"
1528 section)))
1529 (copy-recursively source target)
1530 (delete-file-recursively source)))
1531 '("man3" "man5"))))))))
1532 (native-inputs
1533 (modify-inputs native-inputs
1534 (append docbook-utils)))
1535 (properties (alist-delete 'hidden? (package-properties fontconfig)))))
1536
1537(define-public t1lib
1538 (package
1539 (name "t1lib")
1540 (version "5.1.2")
1541 (source (origin
1542 (method url-fetch)
1543 (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
1544 "graphics/" name "-" version ".tar.gz")
1545 (string-append "https://fossies.org/linux/misc/old/"
1546 name "-" version ".tar.gz")))
1547 (sha256 (base32
1548 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
1549 (patches (search-patches
1550 "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
1551 "t1lib-CVE-2011-0764.patch"
1552 "t1lib-CVE-2011-1552+.patch")))) ; 2011-1553, 2011-1554
1553 (properties `((lint-hidden-cve . ("CVE-2011-0433"
1554 "CVE-2011-1553"
1555 "CVE-2011-1554"
1556 "CVE-2011-5244"))))
1557 (build-system gnu-build-system)
1558 (arguments
1559 ;; Making the documentation requires latex, but t1lib is also an input
1560 ;; for building texlive.
1561 `(#:tests? #f ; no test target
1562 #:configure-flags
1563 '("CFLAGS=-g -O2 -Wno-error=implicit-int")
1564 #:make-flags
1565 '("without_doc")))
1566 (synopsis "Library for generating bitmaps from Type 1 fonts")
1567 (description
1568 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
1569It is based on the code of the X11 rasteriser of the X11 project.
1570
1571The bitmaps created by t1lib are returned in a data structure with type
1572GLYPH. This special GLYPH-type is also used in the X11 window system to
1573describe character bitmaps. It contains the bitmap data as well as some
1574metric information. But t1lib is in itself entirely independent of the
1575X11-system or any other graphical user interface.")
1576 (license license:gpl2)
1577 (home-page "https://www.t1lib.org/")))
1578
1579(define-public teckit
1580 (package
1581 (name "teckit")
1582 (version "2.5.10") ; signed by key 0xC9183BEA0288CDEE
1583 (source
1584 (origin
1585 (method url-fetch)
1586 (uri (string-append "https://github.com/silnrsi/teckit/releases/"
1587 "download/v" version "/teckit-" version ".tar.gz"))
1588 (sha256
1589 (base32 "12qnf8nhxyr4d5pc01s3vc6h726506957an4vvmmfz633cqi5796"))))
1590 (build-system gnu-build-system)
1591 (arguments
1592 '(#:configure-flags '("--disable-static")))
1593 (inputs
1594 (list zlib expat))
1595 (native-inputs
1596 (list perl)) ;for the tests
1597 (synopsis "Toolkit for encoding conversions")
1598 (description
1599 "TECkit is a low-level toolkit intended to be used by other applications
1600that need to perform encoding conversions (e.g., when importing legacy data
1601into a Unicode-based application). The primary component of the TECkit
1602package is therefore a library that performs conversions; this is the
1603\"TECkit engine\". The engine relies on mapping tables in a specific binary
1604format (for which documentation is available); there is a compiler that
1605creates such tables from a human-readable mapping description (a simple
1606text file).
1607
1608To facilitate the development and testing of mapping tables for TECkit,
1609several applications are also included in the current package; these
1610include simple tools for applying conversions to plain-text and Standard
1611Format files, as well as both command-line and simple GUI versions of the
1612TECkit compiler. However, it is not intended that these tools will be the
1613primary means by which end users perform conversions, and they have not
1614been designed, tested, and debugged to the extent that general-purpose
1615applications should be.")
1616 (license license:lgpl2.1+)
1617 (home-page "https://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
1618
1619;; NOTE: A warning from upstream: This program is currently not actively
1620;; maintained, it seems to work fine, but use at your own risk.
1621(define-public go-wrap
1622 (package
1623 (name "go-wrap")
1624 (version "0.3.2")
1625 (source
1626 (origin
1627 (method git-fetch)
1628 (uri (git-reference
1629 ;; Original URL <https://github.com/Wraparound/wrap>, now
1630 ;; redirects to this.
1631 (url "https://github.com/eprovst/wrap")
1632 (commit (string-append "v" version))))
1633 (file-name (git-file-name name version))
1634 (sha256
1635 (base32 "1xk1zii8vqzfys48phpdnr8ign0xvrsfwzyk9m0is9i3rffm25wh"))
1636 (patches (search-patches
1637 "go-github-com-wraparound-wrap-free-fonts.patch"))))
1638 (build-system go-build-system)
1639 (arguments
1640 (list
1641 #:install-source? #f
1642 #:import-path "github.com/eprovst/wrap/cmd/wrap"
1643 #:unpack-path "github.com/eprovst/wrap"
1644 #:phases
1645 #~(modify-phases %standard-phases
1646 (add-after 'install 'wrap-fonts
1647 (lambda* (#:key inputs outputs #:allow-other-keys)
1648 (for-each
1649 (lambda (program)
1650 (wrap-program program
1651 `("XDG_DATA_DIRS" suffix
1652 ,(map dirname
1653 (search-path-as-list '("share/fonts")
1654 (map cdr inputs))))))
1655 (find-files (string-append (assoc-ref outputs "out")
1656 "/bin"))))))))
1657 (native-inputs
1658 (list go-github-com-spf13-cobra
1659 go-github-com-signintech-gopdf
1660 go-github-com-flopp-go-findfont))
1661 (inputs
1662 (list font-liberation
1663 font-gnu-freefont))
1664 (home-page "https://github.com/eprovst/wrap")
1665 (synopsis "Format Fountain screenplays")
1666 (description
1667 "Wrap is a command line tool that is able to convert Fountain files into
1668a correctly formatted screen- or stageplay as an HTML or a PDF. It supports
1669standard Fountain, but also has some custom syntax extensions such as
1670translated keywords and acts.")
1671 (license license:gpl3)))
1672
1673(define-public graphite2
1674 (package
1675 (name "graphite2")
1676 (version "1.3.13")
1677 (source
1678 (origin
1679 (method url-fetch)
1680 (uri (string-append "https://github.com/silnrsi/graphite/releases/"
1681 "download/" version "/" name "-" version ".tgz"))
1682 (sha256
1683 (base32
1684 "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
1685 (build-system cmake-build-system)
1686 (native-inputs
1687 (list python python-fonttools-minimal))
1688 (inputs
1689 (list freetype))
1690 (arguments
1691 (list
1692 #:phases
1693 (if (target-hurd?)
1694 #~(modify-phases %standard-phases
1695 (add-after 'unpack 'apply-patch
1696 (lambda _
1697 ;; use same linker settings as on linux
1698 ;; harfbuzz complains about being linked against libstdc++
1699 (let ((patch #$(local-file
1700 (search-patch "graphite2-non-linux.patch"))))
1701 (invoke "patch" "--force" "-p1" "-i" patch)))))
1702 #~%standard-phases)))
1703 (synopsis "Reimplementation of the SIL Graphite text processing engine")
1704 (description
1705 "Graphite2 is a reimplementation of the SIL Graphite text processing
1706engine. Graphite is a smart font technology designed to facilitate the
1707process known as shaping. This process takes an input Unicode text string
1708and returns a sequence of positioned glyphids from the font.")
1709 (license license:lgpl2.1+)
1710 (home-page "https://github.com/silnrsi/graphite")))
1711
1712(define-public potrace
1713 (package
1714 (name "potrace")
1715 (version "1.16")
1716 (source
1717 (origin
1718 (method url-fetch)
1719 (uri (string-append "mirror://sourceforge/potrace/" version
1720 "/potrace-" version ".tar.gz"))
1721 (sha256
1722 (base32
1723 "1k3sxgjqq0jnpk9xxys05q32sl5hbf1lbk1gmfxcrmpdgnhli0my"))))
1724 (build-system gnu-build-system)
1725 (native-inputs (list ghostscript)) ;for tests
1726 (inputs (list zlib))
1727 (arguments
1728 `(#:configure-flags
1729 `("--with-libpotrace"))) ; install library and headers
1730 (synopsis "Transform bitmaps into vector graphics")
1731 (description
1732 "Potrace is a tool for tracing a bitmap, which means, transforming a
1733bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
1734or BMP format), and the default output is an encapsulated PostScript
1735file (EPS). A typical use is to create EPS files from scanned data, such as
1736company or university logos, handwritten notes, etc. The resulting image is
1737not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
1738resolution.")
1739 (license license:gpl2+)
1740 (home-page "https://potrace.sourceforge.net/")))
1741
1742(define-public psftools
1743 (package
1744 (name "psftools")
1745 (version "1.1.1")
1746 (source
1747 (origin
1748 (method url-fetch)
1749 (uri (string-append "https://www.seasip.info/Unix/PSF/"
1750 "psftools-" version ".tar.gz"))
1751 (sha256
1752 (base32 "1lv6kvrcbspyh7a0hlji84wbmw6xh87r3iaafq3khp88kgh1irri"))))
1753 (build-system gnu-build-system)
1754 (arguments
1755 (list
1756 #:configure-flags #~(list "--disable-static")))
1757 (home-page "https://www.seasip.info/Unix/PSF/")
1758 (synopsis
1759 "Convert PSF fixed-width bitmap (console) fonts from/to other formats")
1760 (description
1761 "@acronym{PSF, PC Screen Font} is the simple monospaced bitmap font format
1762used by the Linux kernel for console fonts. The PSF Tools convert between PSF
1763and many other font formats, similar to what the NetPBM package does for images.
1764
1765It includes converters for a good number of common bitmap font formats such as
1766@file{.BDF}, @file{.FNT}, and @file{.FON} files, Berkeley vfonts, classic
1767Amstrad/Sinclair/Hercules/BBC Micro soft fonts, and raw (DOS-style) fonts.
1768
1769It also supports less traditional formats such as PBM/XBM images, plain text
1770(for rudimentary editing), and C header files.")
1771 (license license:gpl2+)))
1772
1773(define-public libotf
1774 (package
1775 (name "libotf")
1776 (version "0.9.16")
1777 (source (origin
1778 (method url-fetch)
1779 (uri (string-append "mirror://savannah/m17n/libotf-"
1780 version ".tar.gz"))
1781 (sha256
1782 (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
1783 (build-system gnu-build-system)
1784 (native-inputs
1785 (list pkg-config))
1786 (propagated-inputs
1787 (list freetype))
1788 (home-page "https://www.nongnu.org/m17n/")
1789 (synopsis "Library for handling OpenType Font")
1790 (description "This library can read Open Type Layout Tables from an OTF
1791file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
1792GPOS. It can convert a Unicode character sequence to a glyph code sequence by
1793using the above tables.")
1794 (license license:lgpl2.0+)))
1795
1796(define-public libspiro
1797 (package
1798 (name "libspiro")
1799 (version "20200505")
1800 (source
1801 (origin
1802 (method url-fetch)
1803 (uri (string-append "https://github.com/fontforge/libspiro/releases"
1804 "/download/" version "/libspiro-dist-" version ".tar.gz"))
1805 (sha256
1806 (base32
1807 "0j8fmyj4wz6mqk17dqs6f8jx0i52n68gv5px17qbrjnbilg9mih6"))))
1808 (build-system gnu-build-system)
1809 (arguments
1810 '(#:configure-flags '("--disable-static")))
1811 (synopsis "Clothoid to bezier conversion library")
1812 (description
1813 "Raph Levien's Spiro package as a library. A mechanism for drawing
1814smooth contours with constant curvature at the spline joins.")
1815 (license license:gpl2+)
1816 (home-page "https://libspiro.sourceforge.net/")))
1817
1818(define-public libuninameslist
1819 (package
1820 (name "libuninameslist")
1821 (version "20200313")
1822 (home-page "https://github.com/fontforge/libuninameslist")
1823 (source
1824 (origin
1825 (method url-fetch)
1826 (uri (string-append home-page "/releases/download/" version
1827 "/libuninameslist-dist-" version ".tar.gz"))
1828 (sha256
1829 (base32
1830 "10ri80c64xb4rhbif3sr87y5vhi3m702zb0m02imvj1jib9rq0m8"))))
1831 (build-system gnu-build-system)
1832 (synopsis "Unicode names and annotation list")
1833 (description
1834 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
1835useful for programs that need Unicode \"Names\", \"Annotations\", and block
1836definitions.")
1837 ;; COPYING specifies GPL2, but according to LICENSE it only covers the
1838 ;; configure script. The actual code is BSD-3, and the Unicode data
1839 ;; is governed by an X11-style license only found on the web.
1840 (license (list license:bsd-3
1841 (license:x11-style
1842 "https://www.unicode.org/copyright.html#License")))))
1843
1844(define-public fontforge
1845 (package
1846 (name "fontforge")
1847 (version "20230101")
1848 (source (origin
1849 (method url-fetch)
1850 (uri (string-append
1851 "https://github.com/fontforge/fontforge/releases/download/"
1852 version "/fontforge-" version ".tar.xz"))
1853 (sha256
1854 (base32 "1y30bk9rdya8bkw4q77y6nq5xfg7nm0qliz5miqdlk8c0r6fr0na"))))
1855 (build-system cmake-build-system)
1856 (native-inputs
1857 (list pkg-config
1858 python-setuptools))
1859 (inputs
1860 (list cairo
1861 bash-minimal
1862 fontconfig ;dlopen'd
1863 freetype
1864 gettext-minimal
1865 libice
1866 libsm
1867 libx11
1868 libxi
1869 libjpeg-turbo
1870 libltdl
1871 libpng
1872 libspiro
1873 libtiff
1874 libungif
1875 libxft
1876 libxml2
1877 pango
1878 potrace
1879 python
1880 ;; XXX: Python 3.12 lacks distutils:
1881 ;; ModuleNotFoundError: No module named 'distutils'
1882 ;; Remove when package is updated.
1883 python-setuptools-bootstrap
1884 zlib))
1885 (arguments
1886 (append
1887 (if (system-hurd?)
1888 (list #:test-exclude "test0001_py|test0001_pyhook")
1889 '())
1890 (list
1891 #:configure-flags #~`(;; TODO: Provide GTK+ for the Wayland-friendly GDK
1892 ;; backend, instead of the legacy X11 backend.
1893 ;; Currently it introduces a circular dependency.
1894 "-DENABLE_X11=ON")
1895 #:phases
1896 #~(modify-phases %standard-phases
1897 (add-after 'unpack 'do-not-override-RPATH
1898 (lambda _
1899 ;; Do not attempt to set a default RPATH, as our ld-wrapper
1900 ;; already does the right thing.
1901 (substitute* "CMakeLists.txt"
1902 (("^set_default_rpath\\(\\)")
1903 ""))))
1904 (add-after 'unpack 'do-not-use-msgfmt--check
1905 (lambda _
1906 ;; msgfmt --check from gettext-0.23 fails on fr.po:
1907 ;; 'msgstr' is not a valid C format string
1908 (substitute* "po/CMakeLists.txt"
1909 ((" --check") ""))))
1910 #$@(if (target-hurd?)
1911 #~((add-after 'unpack 'apply-hurd-patch
1912 (lambda _
1913 (let ((patch-file
1914 #$(local-file
1915 (search-patch "fontforge-hurd.patch"))))
1916 (invoke "patch" "--force" "-p1" "-i" patch-file)))))
1917 #~())
1918 (add-after 'install 'set-library-path
1919 (lambda* (#:key inputs outputs #:allow-other-keys)
1920 (let ((out (assoc-ref outputs "out"))
1921 (potrace (dirname
1922 (search-input-file inputs "bin/potrace"))))
1923 (wrap-program (string-append out "/bin/fontforge")
1924 ;; Fontforge dynamically opens libraries.
1925 `("LD_LIBRARY_PATH" ":" prefix
1926 ,(map (lambda (input)
1927 (string-append (assoc-ref inputs input)
1928 "/lib"))
1929 '("libtiff" "libjpeg-turbo" "libpng" "libungif"
1930 "libxml2" "zlib" "libspiro" "freetype"
1931 "pango" "cairo" "fontconfig-minimal")))
1932 ;; Checks for potrace program at runtime
1933 `("PATH" ":" prefix (,potrace))))))))))
1934 (synopsis "Outline font editor")
1935 (description
1936 "FontForge allows you to create and modify postscript, truetype and
1937opentype fonts. You can save fonts in many different outline formats, and
1938generate bitmaps.")
1939 (license license:gpl3+)
1940 (home-page "https://fontforge.github.io")))
1941
1942(define-public python-statmake
1943 (package
1944 (name "python-statmake")
1945 (version "0.6.0")
1946 (source (origin
1947 (method git-fetch)
1948 (uri (git-reference
1949 (url "https://github.com/daltonmaag/statmake")
1950 (commit (string-append "v" version))))
1951 (file-name (git-file-name name version))
1952 (sha256
1953 (base32
1954 "1k6fkzyhsfkgi599sb017wzf4jzbnp5wjg1kla1b33vgjpa7n5nw"))))
1955 (build-system pyproject-build-system)
1956 (arguments
1957 (list
1958 #:test-flags
1959 ;; The code no longer raises <class 'ValueError'>
1960 '(list "-k" "not test_load_stylespace_broken_range")))
1961 (native-inputs
1962 (list python-poetry-core
1963 python-pytest
1964 python-ufo2ft))
1965 (propagated-inputs
1966 (list python-attrs
1967 python-cattrs
1968 python-fonttools))
1969 (home-page "https://github.com/daltonmaag/statmake")
1970 (synopsis "Apply OpenType STAT information to a variable font")
1971 (description
1972 "@command{statmake} takes a user-written Stylespace that defines
1973@url{https://docs.microsoft.com/en-us/typography/opentype/spec/stat, OpenType
1974STAT information} for an entire font family and then (potentially subsets and)
1975applies it to a specific variable font. This spares users from having to deal
1976with @url{https://github.com/fonttools/fonttools/, raw TTX dumps} and juggling
1977with @samp{nameIDs}.")
1978 (license license:expat)))
1979
1980(define-public python-ufolib2
1981 (package
1982 (name "python-ufolib2")
1983 (version "0.18.1")
1984 (source
1985 (origin
1986 (method url-fetch)
1987 (uri (pypi-uri "ufolib2" version))
1988 (sha256
1989 (base32 "1971ibdsgji8x0jzlk1hc6dv2r5wnfyylz7f6wjkymqw6v6fzq3x"))))
1990 (build-system pyproject-build-system)
1991 (native-inputs
1992 (list python-pytest
1993 python-setuptools
1994 python-setuptools-scm
1995 python-wheel))
1996 (propagated-inputs
1997 (list python-attrs
1998 python-fonttools))
1999 (home-page "https://github.com/fonttools/ufoLib2")
2000 (synopsis "Unified Font Object (UFO) font processing library")
2001 (description "The ufoLib2 Python library is meant to be a thin
2002representation of the Unified Font Object (UFO) version 3 data model, intended
2003for programmatic manipulation and fast batch processing of UFOs. It resembles
2004the defcon library, but does without notifications, the layout engine and
2005other support classes. Where useful and possible, ufoLib2 tries to be
2006API-compatible with defcon.")
2007 (license license:asl2.0)))
2008
2009;;; A variant used to break a cycle between python-fontpens and
2010;;; python-fontparts.
2011(define-public python-defcon-bootstrap
2012 (hidden-package
2013 (package
2014 (name "python-defcon-bootstrap")
2015 (version "0.12.2")
2016 (source
2017 (origin
2018 (method git-fetch)
2019 (uri (git-reference
2020 (url "https://github.com/robotools/defcon")
2021 (commit version)))
2022 (file-name (git-file-name name version))
2023 (sha256
2024 (base32 "1zx4xas6qcpp54d1vcfy5wjv17aazkpfmb7hkjy99g47xsi6crrh"))))
2025 (build-system pyproject-build-system)
2026 (propagated-inputs (list python-fontpens-bootstrap python-fonttools))
2027 (native-inputs
2028 (list python-pytest
2029 python-setuptools
2030 python-setuptools-scm))
2031 (home-page "https://github.com/robotools/defcon")
2032 (synopsis "Flexible objects for representing UFO data")
2033 (description
2034 "Defcon is a set of @acronym{UFO, unified font object} based
2035objects optimized for use in font editing applications. The objects are built
2036to be lightweight, fast and flexible. The objects are very bare-bones and
2037they are not meant to be end-all, be-all objects. Rather, they are meant to
2038provide base functionality so that you can focus on your application’s
2039behavior, not object observing or maintaining cached data. Defcon implements
2040UFO3 as described by the UFO font format.")
2041 (license license:expat))))
2042
2043(define-public python-defcon
2044 (package/inherit python-defcon-bootstrap
2045 (name "python-defcon")
2046 (propagated-inputs
2047 (modify-inputs propagated-inputs
2048 (replace "python-fontpens-bootstrap" python-fontpens)))
2049 (properties
2050 (alist-delete 'hidden?
2051 (package-properties python-fontparts-bootstrap)))))
2052
2053(define-public nototools
2054 (package
2055 (name "nototools")
2056 (version "0.3.2")
2057 (source
2058 (origin
2059 (method git-fetch)
2060 (uri (git-reference
2061 (url "https://github.com/googlefonts/nototools")
2062 (commit (string-append "v" version))))
2063 (file-name (git-file-name name version))
2064 (sha256
2065 (base32 "1sfsmfxcp4kdkra58z274w9cjgyim4by50nxdq60q3z1r5hv9iyj"))))
2066 (build-system pyproject-build-system)
2067 (arguments
2068 (list
2069 #:phases
2070 #~(modify-phases %standard-phases
2071 (replace 'check
2072 (lambda* (#:key tests? #:allow-other-keys)
2073 (with-directory-excursion "tests"
2074 (invoke "./run_tests")))))))
2075 (native-inputs (list python-setuptools-scm python-setuptools))
2076 (propagated-inputs (list python-afdko python-pillow))
2077 (home-page "https://github.com/googlei18n/nototools")
2078 (synopsis "Noto fonts support tools and scripts")
2079 (description
2080 "Nototools is a Python package containing Python scripts used to
2081maintain the Noto Fonts project.")
2082 (license (list license:asl2.0
2083 ;; Sample texts are attributed to UN and OHCHR.
2084 ;; The permissions on the UDHR are pretty lax:
2085 ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
2086 ;; "If UDHR translations or materials are reproduced, users
2087 ;; should make reference to this website as a source by
2088 ;; providing a link."
2089 license:public-domain
2090 (license:non-copyleft
2091 "file://sample_texts/attributions.txt"
2092 "See sample_texts/attributions.txt in the distribution.")))))
2093
2094(define-public fcft
2095 (package
2096 (name "fcft")
2097 (version "3.3.3")
2098 (home-page "https://codeberg.org/dnkl/fcft")
2099 (source (origin
2100 (method git-fetch)
2101 (uri (git-reference (url home-page) (commit version)))
2102 (file-name (git-file-name name version))
2103 (sha256
2104 (base32
2105 "0653l611lfkry6lcpbhvcpd9lsrv9ybfabxafpwa39jn3ykaah9j"))))
2106 (build-system meson-build-system)
2107 (native-inputs
2108 (list check pkg-config scdoc))
2109 (propagated-inputs
2110 (list ;; Required by fcft.pc.
2111 utf8proc
2112 fontconfig
2113 freetype
2114 harfbuzz
2115 pixman
2116 tllist))
2117 (synopsis "Font loading and glyph rasterization library")
2118 (description
2119 "@code{fcft} is a small font loading and glyph rasterization library
2120built on-top of FontConfig, FreeType2 and pixman.
2121
2122It can load and cache fonts from a fontconfig-formatted name string, e.g.
2123@code{Monospace:size=12}, optionally with user configured fallback fonts.
2124
2125After a font has been loaded, you can rasterize glyphs. When doing so, the
2126primary font is first considered. If it does not have the requested glyph,
2127the user configured fallback fonts (if any) are considered. If none of the
2128user configured fallback fonts has the requested glyph, the FontConfig
2129generated list of fallback fonts are checked.")
2130 ;; The code is distributed under the Expat license, but embeds Unicode
2131 ;; data files carrying the Unicode license.
2132 (license (list license:expat license:unicode))))
2133
2134(define-public fontmanager
2135 (package
2136 (name "fontmanager")
2137 (version "0.9.0")
2138 (source
2139 (origin
2140 (method git-fetch)
2141 (uri (git-reference
2142 (url "https://github.com/FontManager/font-manager")
2143 (commit version)))
2144 (file-name (git-file-name name version))
2145 (sha256
2146 (base32 "0pxdwpjzsmld4j2m4q423vdrkx23bb6jqszjgk5wqbr2ln772hcx"))))
2147 (build-system meson-build-system)
2148 (arguments
2149 (list #:glib-or-gtk? #t
2150 #:build-type "release"
2151 #:configure-flags
2152 #~(list (string-append "-Dc_link_args=-Wl,-rpath=" #$output
2153 "/lib/font-manager"))
2154 #:phases
2155 #~(modify-phases %standard-phases
2156 (add-after 'unpack 'skip-gtk-update-icon-cache
2157 (lambda _
2158 ;; Remove dependency on needless desktop cache stuff.
2159 (substitute* "meson.build"
2160 (("gtk_update_icon_cache: true")
2161 "gtk_update_icon_cache: false")
2162 (("update_desktop_database: true")
2163 "update_desktop_database: false")))))))
2164 (native-inputs
2165 (list desktop-file-utils
2166 gettext-minimal
2167 `(,glib "bin")
2168 gobject-introspection
2169 pkg-config
2170 python-wrapper
2171 vala
2172 yelp-tools))
2173 (inputs
2174 (list fontconfig
2175 freetype
2176 gsettings-desktop-schemas
2177 gtk
2178 json-glib
2179 libsoup
2180 sqlite
2181 webkitgtk))
2182 (home-page "https://fontmanager.github.io/")
2183 (synopsis "Simple font management for GTK desktop environments")
2184 (description "Font Manager is intended to provide a way for users to
2185easily manage desktop fonts, without having to resort to command-line
2186tools or editing configuration files by hand.
2187While designed primarily with the GNOME Desktop Environment in mind, it should
2188work well with other GTK desktop environments.")
2189 (license license:gpl3+)))
2190
2191(define-public fntsample
2192 (package
2193 (name "fntsample")
2194 (version "5.4")
2195 (source (origin
2196 (method git-fetch)
2197 (uri (git-reference
2198 (url "https://github.com/eugmes/fntsample")
2199 (commit (string-append "release/" version))))
2200 (file-name (git-file-name name version))
2201 (sha256
2202 (base32
2203 "0pcqqdriv6hq64zrqd9vhdd9p2vhimjnajcxdz10qnqgrkmm751v"))))
2204 (build-system cmake-build-system)
2205 (arguments
2206 `(#:tests? #f ; There are no tests.
2207 #:configure-flags
2208 (list (string-append
2209 "-DUNICODE_BLOCKS=" (assoc-ref %build-inputs "ucd")
2210 "/share/ucd/Blocks.txt"))
2211 #:phases
2212 (modify-phases %standard-phases
2213 (add-after 'install 'set-library-path
2214 (lambda* (#:key inputs outputs #:allow-other-keys)
2215 (let* ((out (assoc-ref outputs "out"))
2216 (pdf-api2 (assoc-ref inputs "perl-pdf-api2"))
2217 (intl (assoc-ref inputs "perl-libintl-perl"))
2218 (perllib (string-append pdf-api2
2219 "/lib/perl5/site_perl/"
2220 ,(package-version perl)
2221 ":" intl
2222 "/lib/perl5/site_perl/"
2223 ,(package-version perl))))
2224 (wrap-program (string-append out "/bin/pdfoutline")
2225 `("PERL5LIB" ":" prefix (,perllib)))))))))
2226 (native-inputs
2227 `(("pkg-config" ,pkg-config)
2228 ("gettext" ,gettext-minimal)))
2229 (inputs
2230 `(("cairo" ,cairo)
2231 ("bash-minimal" ,bash-minimal)
2232 ("fontconfig" ,fontconfig)
2233 ("freetype" ,freetype)
2234 ("glib" ,glib)
2235 ("pango" ,pango)
2236 ("perl" ,perl) ;needed for pdfoutline
2237 ("perl-pdf-api2" ,perl-pdf-api2)
2238 ("perl-libintl-perl" ,perl-libintl-perl)
2239 ("ucd" ,ucd)))
2240 (home-page "https://github.com/eugmes/fntsample")
2241 (synopsis "PDF and PostScript font samples generator")
2242 (description "This package provides a tool that can be used to make font
2243samples that show coverage of the font and are similar in appearance to
2244Unicode Charts. It was developed for use with DejaVu Fonts project.
2245
2246This package also includes the @command{pdfoutline} script, which can be used
2247to modify outlines (machine-readable tables of contents) in PDF files.")
2248 (license license:gpl3+)))
2249
2250(define-public libraqm
2251 (package
2252 (name "libraqm")
2253 (version "0.10.1")
2254 (source
2255 (origin
2256 (method git-fetch)
2257 (uri (git-reference
2258 (url "https://github.com/HOST-Oman/libraqm")
2259 (commit (string-append "v" version))))
2260 (file-name (git-file-name name version))
2261 (sha256
2262 (base32 "1bzdrvacgj9629r4mgmag9sm5ay5914fbs8pnxf8xphvrbnbxm8z"))))
2263 (build-system meson-build-system)
2264 (native-inputs
2265 (list gtk-doc/stable pkg-config python-wrapper))
2266 (inputs
2267 (list freetype fribidi harfbuzz))
2268 (home-page "https://github.com/HOST-Oman/libraqm")
2269 (synopsis "Library for complex text layout")
2270 (description
2271 "Raqm is a small library that encapsulates the logic for complex text
2272layout and provides a convenient API.
2273
2274It currently provides bidirectional text support (using FriBiDi),
2275shaping (using HarfBuzz), and proper script itemization. As a result, Raqm
2276can support most writing systems covered by Unicode.")
2277 (license license:expat)))
2278
2279
2280(define-public fontopia
2281 (package
2282 (name "fontopia")
2283 (version "2.0")
2284 (source (origin
2285 (method url-fetch)
2286 (uri (string-append "mirror://gnu/fontopia/fontopia-"
2287 version ".tar.gz"))
2288 (sha256
2289 (base32 "0wv7bd7gdm1ma4xgq9av73ic3xhpwyszj6g6c6311xjk26xm9ahd"))))
2290 (build-system gnu-build-system)
2291 (inputs
2292 (list gnudos))
2293 (home-page "https://www.gnu.org/software/fontopia/")
2294 (synopsis "Text-based, console font editor")
2295 (description
2296 "GNU fontopia is an easy-to-use, text-based, console font editor. You can
2297edit the fonts that your GNU/Linux kernel is using to display your text on text-
2298based (vs graphical) terminals.")
2299 (license license:gpl3+)))
2300
2301(define-public birdfont
2302 (package
2303 (name "birdfont")
2304 (version "2.33.6")
2305 (source (origin
2306 (method git-fetch)
2307 (uri (git-reference
2308 (url "https://github.com/johanmattssonm/birdfont")
2309 (commit (string-append "v" version))))
2310 (file-name (git-file-name name version))
2311 (sha256
2312 (base32
2313 "137qmfjdhs8m06j95iqcdv5hrpp2kf8p6l0sa0jr7vl7ziin65gg"))))
2314 (build-system gnu-build-system)
2315 (arguments (list
2316 #:tests? #f ; no tests
2317 #:phases
2318 #~(modify-phases %standard-phases
2319 (replace 'configure
2320 (lambda* (#:key outputs (configure-flags '()) #:allow-other-keys)
2321 (let ((out (assoc-ref outputs "out")))
2322 (apply system*
2323 "python3"
2324 "configure"
2325 ;; Required for RUNPATH validation.
2326 (string-append "--ldflags=-Wl,-rpath=" out "/lib")
2327 (string-append "--prefix=" out)
2328 configure-flags))))
2329 (replace 'build
2330 (lambda _ (system* "python3" "build.py")))
2331 (replace 'install
2332 (lambda _ (system* "python3" "install.py" "--libdir=/lib"))))))
2333 (inputs (list cairo
2334 gdk-pixbuf
2335 glib
2336 gtk+
2337 libgee
2338 libnotify
2339 libsoup
2340 sqlite
2341 webkitgtk-for-gtk3
2342 xmlbird))
2343 (native-inputs (list gettext-minimal
2344 pkg-config
2345 python-doit
2346 python-wrapper
2347 vala))
2348 (home-page "https://github.com/johanmattssonm/birdfont")
2349 (synopsis "Font editor for creating fonts in TTF, EOT, and SVG format")
2350 (description "Birdfont is a font editor which can create vector graphics and export
2351TTF, EOT, and SVG fonts. It includes a graphical as well as a commandline interface.")
2352 (license license:gpl3)))
2353
2354(define-public lcdf-typetools
2355 (package
2356 (name "lcdf-typetools")
2357 (version "2.108")
2358 (source (origin
2359 (method git-fetch)
2360 (uri (git-reference
2361 (url "https://github.com/kohler/lcdf-typetools")
2362 (commit (string-append "v" version))))
2363 (file-name (git-file-name name version))
2364 (sha256
2365 (base32
2366 "0a6jqaqwq43ldjjjlnsh6mczs2la9363qav7v9fyrfzkfj8kw9ad"))))
2367 (build-system gnu-build-system)
2368 (arguments
2369 `(#:configure-flags
2370 ;; This is only provided by the monolithic texlive distribution.
2371 ;; FIXME: texlive-kpathsea doesn't come with the library and headers
2372 (list "--without-kpathsea")))
2373 (native-inputs
2374 (list autoconf automake))
2375 (home-page "https://lcdf.org/type/")
2376 (synopsis "Multiple font manipulation tools")
2377 (description "LCDF Typetools comprises several programs for manipulating
2378PostScript Type 1, Type 1 Multiple Master, OpenType, and TrueType fonts.
2379These tools are cfftot1, mmafm, mmpfb, otfinfo, otftotfm, t1dotlessj, t1lint,
2380t1rawfm, t1reencode, t1testpage and ttftotype42.")
2381 (license license:gpl2+)))
2382
2383(define-public bdf2sfd
2384 (package
2385 (name "bdf2sfd")
2386 (version "1.1.8")
2387 (source (origin
2388 (method git-fetch)
2389 (uri (git-reference
2390 (url "https://github.com/fcambus/bdf2sfd")
2391 (commit "1.1.8")))
2392 (file-name (git-file-name name version))
2393 (sha256
2394 (base32
2395 "0pa92gjiijp9xqnw9dcvz24s6qk11a4lp5q6s5psd6mpkhpd88zq"))))
2396 (build-system cmake-build-system)
2397 (home-page "https://github.com/fcambus/bdf2sfd")
2398 (synopsis "BDF to SFD converter, allowing to vectorize bitmap fonts")
2399 (description
2400 "bdf2sfd is a
2401@uref{https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format,
2402BDF} to @uref{https://fontforge.org/docs/techref/sfdformat.html, SFD}
2403converter, allowing to vectorize bitmap fonts. It works by converting
2404each pixel of a glyph to a polygon, which produces large and
2405unoptimized SFD files that should be post-processed using
2406@uref{https://fontforge.org, FontForge}.")
2407 (license license:bsd-2)))