diff options
Diffstat (limited to 'gnu/packages/fontutils.scm')
-rw-r--r-- | gnu/packages/fontutils.scm | 341 |
1 files changed, 241 insertions, 100 deletions
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 294a2f2c38..9394c80236 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -12,8 +12,9 @@ ;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org> ;;; Copyright © 2020 Roel Janssen <roel@gnu.org> ;;; Copyright © 2020, 2021, 2024 Nicolas Goaziou <mail@nicolasgoaziou.fr> -;;; Copyright © 2021-2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2021-2025 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> +;;; Copyright © 2022 Eric Bavier <bavier@posteo.net> ;;; Copyright © 2022 Felipe Balbi <balbi@kernel.org> ;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com> ;;; Copyright © 2023 John Kehayias <john.kehayias@protonmail.com> @@ -24,6 +25,7 @@ ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Sou Bunnbu (宋文武) <iyzsong@gmail.com> ;;; Copyright © 2025 Ashish SHUKLA <ashish.is@lostca.se> +;;; Copyright © 2025 Alexey Abramov <levenson@mmer.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -113,7 +115,14 @@ ;; The use of "freetype-config" is deprecated, but other packages still ;; depend on it. (list - #:configure-flags #~(list "--enable-freetype-config") + #:configure-flags #~(list "--enable-freetype-config" + ;; armhf-linux: Disable SLP vectorization. + ;; gcc-14 optimization bug that breaks + ;; ghostscript PostScript font handling (fixed + ;; in gcc-15). See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119155 + #$@(if (target-arm32?) + (list "CFLAGS=-g -O2 -fno-tree-slp-vectorize") + '())) #:disallowed-references (list pkg-config) #:phases #~(modify-phases %standard-phases @@ -172,13 +181,13 @@ them as it goes.") (define-public python-afdko (package (name "python-afdko") - (version "3.9.5") + (version "4.0.2") (source (origin (method url-fetch) (uri (pypi-uri "afdko" version)) (sha256 - (base32 "02c1rjx7ggbd1m9vqgsc2r28yiw66cjgvs5cq1a2fz0lkadbvrnb")) + (base32 "0c6ribidsmcd9rihy32gknfrr3iw8dy2jlmq6lk05pc33s3ix8z1")) (modules '((guix build utils))) (snippet #~(begin @@ -187,9 +196,31 @@ them as it goes.") (for-each delete-file (find-files "." "Feat(Parser|Lexer).*\\.(h|cpp|interp|tokens)$"))))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list + #:test-flags + #~(list + "--dist" "loadfile" "-n" + (number->string (parallel-job-count)) + "-k" (string-join + ;; This test fails because of a different date + ;; in the copyright header of an expected file + ;; since an update to ffmpeg. + '("not test_alt_missing_glyph" + ;; AssertionError: assert False + "test_build_font_and_check_messages" + "test_duplicate_warning_messages_bug751" + "test_cli_numerics" + ;; The test_decimals_ufo and + ;; test_type1_supported_hint started failing in + ;; 4.0.2, due to small variations compared to the + ;; expected output, likely caused by our newer + ;; python-fonttools (see: + ;; <https://github.com/adobe-type-tools/afdko/issues/1805>). + "test_decimals_ufo" + "test_type1_supported_hint") + " and not ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'use-c++17 @@ -233,19 +264,17 @@ them as it goes.") antlr-version "\""))) (invoke "python" "BuildGrammar.py"))))) + (add-before 'build 'relax-gcc-warnings + (lambda _ + ;; Relax a warning turned error with GCC 14. + (setenv "CFLAGS" (string-join + (list "-g" "-O2" + "-Wno-error=incompatible-pointer-types" + "-Wno-error=int-conversion") + " ")))) ;; The test suite expects the commands to be Python rather than ;; shell scripts, so move the wrap phase after the tests. (delete 'wrap) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (setenv "HOME" "/tmp") - (invoke "pytest" "-vv" "--dist" "loadfile" "-n" - (number->string (parallel-job-count)) - ;; This test fails because of a different date in the - ;; copyright header of an expected file since an - ;; update to ffmpeg. - "-k" "not test_alt_missing_glyph")))) (add-after 'check 'wrap (assoc-ref %standard-phases 'wrap)) (add-before 'wrap 'wrap-PATH @@ -280,7 +309,7 @@ them as it goes.") python-defcon python-fontmath python-fonttools - python-lxml + python-lxml-4.9 python-tqdm python-ufonormalizer python-ufoprocessor)) @@ -376,10 +405,28 @@ but also provides many useful font conversion and analysis facilities. "CFLAGS = -Wno-error=incompatible-pointer-types")))) (add-before 'build 'set-CC (lambda _ - (setenv "CC" "gcc")))))) + (setenv "CC" "gcc"))) + (replace 'check + ;; tests: 646 passed, 4 skipped, 40 warnings + ;; TODO: Try to fix more tests if this package is still required. + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (setenv "HOME" "/tmp") + (invoke "pytest" "-vv" + "-n" (number->string (min 8 (parallel-job-count))) + "--ignore=tests/buildcff2vf_test.py" + "--ignore=tests/comparefamily_test.py" + "--ignore=tests/makeinstancesufo_test.py" + "--ignore=tests/makeotf_test.py" + "--ignore=tests/makeotfexe_test.py" + "--ignore=tests/otc2otf_test.py" + "--ignore=tests/otf2ttf_test.py" + "--ignore=tests/proofpdf_test.py" + "--ignore=tests/ttxn_test.py"))))))) (native-inputs (list pkg-config python-pytest + python-pytest-xdist python-setuptools-scm python-wheel)) (inputs @@ -430,7 +477,7 @@ other operations on paths.") (define-public python-cffsubr (package (name "python-cffsubr") - (version "0.2.9.post1") + (version "0.3.0") (source (origin (method url-fetch) @@ -438,7 +485,7 @@ other operations on paths.") (modules '((guix build utils))) (snippet '(delete-file-recursively "external")) ;unbundle ADFKO (sha256 - (base32 "0p7wyagkmwf4agr6ysgswrpmpifx5rz8dnjbcs2gmj29rwnl2cbb")))) + (base32 "1yrfjn3mdi48pg78yzlmskdz9i4nf2wg7h8ivnn9yrw1vc5iaibp")))) (build-system python-build-system) (arguments (list @@ -485,42 +532,48 @@ Kit for OpenType (AFDKO) @command{tx} tool.") (define-public python-compreffor (package (name "python-compreffor") - (version "0.5.4") + (version "0.5.6") (source (origin - (method url-fetch) - (uri (pypi-uri "compreffor" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/googlefonts/compreffor") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "05gpszc8xh6wn3mdra05d6yz6ns624y67m9xs4vv8gh68m0aasrh")))) - (build-system python-build-system) + (base32 "04pgh1ajglvzm229c4janazfillh9156i4zrkhkyn2mb3dm1zq6y")))) + (build-system pyproject-build-system) (arguments (list + #:test-flags #~(list "--pyargs" "compreffor") #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'patch-setup.py + (add-after 'unpack 'set-version (lambda _ - (substitute* "setup.py" - ;; Not actually needed. - ((", \"setuptools_git_ls_files\"") ""))))))) - (native-inputs (list python-pytest python-pytest-runner - python-setuptools-scm)) + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) + (native-inputs + (list python-cython + python-pytest + python-setuptools + python-setuptools-scm)) (propagated-inputs (list python-fonttools-minimal)) (home-page "https://github.com/googlefonts/compreffor") (synopsis "@acronym{CFF, Compact Font Format} subroutinizer for fontTools") - (description "This package provides a @acronym{CFF, Compact Font Format} -subroutinizer for fontTools.") + (description + "This package provides a @acronym{CFF, Compact Font Format} subroutinizer +for fontTools.") (license license:asl2.0))) (define-public python-cu2qu (package (name "python-cu2qu") - (version "1.6.7.post1") + (version "1.6.7.post2") (source (origin (method url-fetch) (uri (pypi-uri "cu2qu" version ".zip")) (sha256 - (base32 "1x762r7bf39g6aivfvrmq00h6f07abvs9x1xm0fz8l81vq8jz64c")))) + (base32 "022qpzbpi6j56wqz48rnqs6dvksipw13fi4g10k941fnkgcn5x8x")))) (build-system pyproject-build-system) (arguments ;; XXX: Try to remove it when updating python-fonttools. @@ -546,14 +599,24 @@ converts any cubic curves to quadratic. The most useful function is probably (define-public python-ufo2ft (package (name "python-ufo2ft") - (version "2.31.0") + (version "2.33.4") (source (origin (method url-fetch) (uri (pypi-uri "ufo2ft" version)) (sha256 - (base32 "1rg2997af8blvswlwif0kpz2vxrlh555gzqslz6yv9y7i7v8lphl")))) + (base32 "0xnnwlj3rl0p7q19l6wdrfkzzq1f2l5vyl2qs7kl4vvfalgpzakv")))) (build-system pyproject-build-system) + (arguments + (list #:test-flags + #~(list "-k" + ;; XXX: These tests all fail with "TTX output is different + ;; from expected". Potentially fixed in 3.x release. + (string-append "not test_compileVariableTTF " + "and not test_compileVariableCFF2 " + "and not test_drop_glyph_names_variable " + "and not test_buildTables_FeatureLibError " + "and not test_kern_zyyy_zinh")))) (native-inputs (list python-pytest python-setuptools-scm @@ -580,20 +643,29 @@ to generate OpenType font binaries from Unified Font Objects (UFOs).") (define-public python-fontmath (package (name "python-fontmath") - (version "0.9.3") + (version "0.9.4") (source (origin - (method url-fetch) - (uri (pypi-uri "fontMath" version ".zip")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/robotools/fontMath") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "070v1jz5f18g15if459ppwswq4w5hzffwp1gvdc5j47bgz5qflva")))) - (build-system python-build-system) + (base32 "0g8vpwn4flg0rj7ar8wl9xlpjhcgiz01p56fzkjdlf2jqb36akyy")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-version + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) (propagated-inputs (list python-fonttools-minimal)) (native-inputs - (list python-setuptools-scm - python-pytest - python-pytest-runner - python-wheel + (list python-pytest + python-setuptools + python-setuptools-scm unzip)) (home-page "https://github.com/robotools/fontMath") (synopsis "Fast font mathematical operations library") @@ -653,20 +725,25 @@ implementing the pen protocol for manipulating glyphs.") (hidden-package (package (name "python-fontparts-bootstrap") - (version "0.11.0") + (version "0.13.3") (source (origin (method url-fetch) - (uri (pypi-uri "fontParts" version ".zip")) + (uri (pypi-uri "fontparts" version ".tar.gz")) (sha256 - (base32 "0j4h8hszky639gmfy1avmw670y80ya49kca8yc635h5ihl0c3v8x")))) - (build-system python-build-system) + (base32 "0ddyfa975hskaip6l4hn7n2jh50y5s0pw911phyx2fsws54pw5s7")))) + (build-system pyproject-build-system) + (arguments + (list #:test-backend #~'custom + #:test-flags #~(list "Lib/fontParts/fontshell/test.py"))) (propagated-inputs (list python-booleanoperations python-defcon-bootstrap python-fontmath python-fonttools-minimal)) - (native-inputs (list python-setuptools-scm unzip)) + (native-inputs + (list python-setuptools + python-setuptools-scm)) (home-page "https://github.com/robotools/fontParts") (synopsis "Library for interacting with font parts") (description "FontParts is an @acronym{API, Application Programming @@ -684,6 +761,47 @@ process. FontParts is the successor of RoboFab.") (alist-delete 'hidden? (package-properties python-fontparts-bootstrap))))) +(define-public python-freetype-py + (package + (name "python-freetype-py") + (version "2.5.1") + (source + (origin + (method git-fetch) ;no tests in PyPI archive + (uri (git-reference + (url "https://github.com/rougier/freetype-py") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0cls0469zfqzwpq6k4pxa9vrczsqabqk4qh7444xybcyq9qgs1lp")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags #~(list "tests") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-lib-paths + (lambda _ + (substitute* "freetype/raw.py" + (("ctypes.util.find_library\\('freetype'\\)") + (format #f "'~a/~a'" #$(this-package-input "freetype") + "lib/libfreetype.so"))))) + (add-before 'build 'set-version + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) + (native-inputs + (list python-pytest + python-setuptools + python-setuptools-scm)) + (inputs + (list freetype)) + (home-page "https://github.com/rougier/freetype-py") + (synopsis "Freetype python bindings") + (description + "Freetype Python provides bindings for the FreeType library. Only the +high-level API is bound.") + (license license:bsd-3))) + (define-public python-glyphslib (package (name "python-glyphslib") @@ -928,7 +1046,7 @@ converter from FontForge’s @acronym{SFD, Spline Font Database} fonts to (snippet '(delete-file-recursively "src/cpp")) ;140+ MiB of stuff (sha256 (base32 "1vlwl1w6sn8c78fsh1w549n3lk9v3v9hcp866vrsdr4byb7g2ani")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases @@ -941,14 +1059,10 @@ converter from FontForge’s @acronym{SFD, Spline Font Database} fonts to ;; Our version of Skia requires c++17. (substitute* "setup.py" (("-std=c\\+\\+14") - "-std=c++17")))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv"))))))) + "-std=c++17"))))))) (native-inputs (list pkg-config - python-cython + python-cython-0 python-pytest python-setuptools-scm unzip)) @@ -963,13 +1077,13 @@ paths (intersection, union, difference, xor).") (define-public python-ufoprocessor (package (name "python-ufoprocessor") - (version "1.9.0") + (version "1.14.0") (source (origin (method url-fetch) - (uri (pypi-uri "ufoProcessor" version ".zip")) + (uri (pypi-uri "ufoprocessor" version ".tar.gz")) (sha256 - (base32 "0ns11aamgavgsfj8qf5kq7dvzmgl0mhr1cbych2f075ipfdvva5s")))) + (base32 "08bkci1fwpx2jfgh3rw48qangs84ngn8lqpqk5fhrgs43hjwpki1")))) (build-system python-build-system) (arguments (list #:phases #~(modify-phases %standard-phases @@ -985,7 +1099,7 @@ paths (intersection, union, difference, xor).") python-fontparts python-fonttools-minimal python-mutatormath)) - (native-inputs (list python-setuptools-scm unzip)) + (native-inputs (list python-setuptools-scm)) (home-page "https://github.com/LettError/ufoProcessor") (synopsis "Process and generate @acronym{UFO, Unified Font Object} files") (description "This Python package processes and generates instances for @@ -1006,21 +1120,33 @@ tools can generate partial instances. (define-public python-ufonormalizer (package (name "python-ufonormalizer") - (version "0.6.1") + (version "0.6.3") (source (origin - (method url-fetch) - (uri (pypi-uri "ufonormalizer" version ".zip")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/unified-font-object/ufoNormalizer") + (commit version))) + (file-name (git-file-name name version)) (sha256 - (base32 "0v5awian2alap7nvxfz38aahyqbqnma16nrqcpr8602hbbki04g6")))) - (build-system python-build-system) - (native-inputs (list python-setuptools-scm unzip)) + (base32 "17r72m5gy5fbng3f4vh3z63xjy84q5rdzj5cyvrvwgj33yl6b18k")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-backend #~'unittest + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-version + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) + (native-inputs (list python-setuptools python-setuptools-scm unzip)) (home-page "https://github.com/unified-font-object/ufoNormalizer") (synopsis "Script to normalize @acronym{UFO, Unified Font Object} data") - (description "The purpose of the @command{ufonormalizer} command is to -provide a standard formatting so that updates to @acronym{UFO, Unified Font -Object} data can be usefully versioned. Examples of formatting applied by -ufoNormalizer include: + (description + "The purpose of the @command{ufonormalizer} command is to provide a +standard formatting so that updates to @acronym{UFO, Unified Font Object} data +can be usefully versioned. Examples of formatting applied by ufoNormalizer +include: @itemize @item Changing floating-point numbers to integers where it doesn't alter the value (e.g. @samp{x=\"95.0\"} becomes @samp{x=\"95\"}) @@ -1408,6 +1534,8 @@ high quality, anti-aliased and subpixel rendered text on a display.") ;; Making the documentation requires latex, but t1lib is also an input ;; for building texlive. `(#:tests? #f ; no test target + #:configure-flags + '("CFLAGS=-g -O2 -Wno-error=implicit-int") #:make-flags '("without_doc"))) (synopsis "Library for generating bitmaps from Type 1 fonts") @@ -1813,13 +1941,13 @@ with @samp{nameIDs}.") (define-public python-ufolib2 (package (name "python-ufolib2") - (version "0.13.1") + (version "0.18.1") (source (origin (method url-fetch) - (uri (pypi-uri "ufoLib2" version)) + (uri (pypi-uri "ufolib2" version)) (sha256 - (base32 "0yx4i8q5rfyqhr2fj70a7z1bp1jv7bdlr64ww9z4nv9ycbda4x9j")))) + (base32 "1971ibdsgji8x0jzlk1hc6dv2r5wnfyylz7f6wjkymqw6v6fzq3x")))) (build-system pyproject-build-system) (native-inputs (list python-pytest @@ -1842,40 +1970,53 @@ API-compatible with defcon.") ;;; A variant used to break a cycle between python-fontpens and ;;; python-fontparts. (define-public python-defcon-bootstrap - (package - (name "python-defcon-bootstrap") - (version "0.10.3") - (source - (origin - (method url-fetch) - (uri (pypi-uri "defcon" version ".zip")) - (sha256 - (base32 "036clkwjfv5mmvy6s67s0pbni73n9hdw32z20gm4w5jzqzbjdpjn")))) - (build-system python-build-system) - (propagated-inputs (list python-fontpens-bootstrap python-fonttools)) - (native-inputs - (list python-pytest - python-pytest-runner - python-setuptools-scm - unzip)) - (home-page "https://github.com/robotools/defcon") - (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data") - (description "Defcon is a set of @acronym{UFO, unified font object} based + (hidden-package + (package + (name "python-defcon-bootstrap") + (version "0.12.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/robotools/defcon") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1zx4xas6qcpp54d1vcfy5wjv17aazkpfmb7hkjy99g47xsi6crrh")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-version + (lambda _ + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) + (propagated-inputs (list python-fontpens-bootstrap python-fonttools)) + (native-inputs + (list python-pytest + python-setuptools + python-setuptools-scm)) + (home-page "https://github.com/robotools/defcon") + (synopsis "Flexible objects for representing UFO data") + (description + "Defcon is a set of @acronym{UFO, unified font object} based objects optimized for use in font editing applications. The objects are built to be lightweight, fast and flexible. The objects are very bare-bones and they are not meant to be end-all, be-all objects. Rather, they are meant to provide base functionality so that you can focus on your application’s behavior, not object observing or maintaining cached data. Defcon implements UFO3 as described by the UFO font format.") - (license license:expat))) + (license license:expat)))) (define-public python-defcon - (hidden-package - (package/inherit python-defcon-bootstrap - (name "python-defcon") - (propagated-inputs - (modify-inputs (package-propagated-inputs python-defcon-bootstrap) - (replace "python-fontpens-bootstrap" python-fontpens)))))) + (package/inherit python-defcon-bootstrap + (name "python-defcon") + (propagated-inputs + (modify-inputs (package-propagated-inputs python-defcon-bootstrap) + (replace "python-fontpens-bootstrap" python-fontpens))) + (properties + (alist-delete 'hidden? + (package-properties python-fontparts-bootstrap))))) (define-public nototools (package |