fontutils.scm 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
  4. ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
  7. ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
  8. ;;; Copyright © 2017 Nikita <nikita@n0.is>
  9. ;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  11. ;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  12. ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
  13. ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
  14. ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  15. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  16. ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  17. ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
  18. ;;;
  19. ;;; This file is part of GNU Guix.
  20. ;;;
  21. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  22. ;;; under the terms of the GNU General Public License as published by
  23. ;;; the Free Software Foundation; either version 3 of the License, or (at
  24. ;;; your option) any later version.
  25. ;;;
  26. ;;; GNU Guix is distributed in the hope that it will be useful, but
  27. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  28. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. ;;; GNU General Public License for more details.
  30. ;;;
  31. ;;; You should have received a copy of the GNU General Public License
  32. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  33. (define-module (gnu packages fontutils)
  34. #:use-module (gnu packages)
  35. #:use-module (gnu packages autotools)
  36. #:use-module (gnu packages bison)
  37. #:use-module (gnu packages build-tools) ;for meson-0.55
  38. #:use-module (gnu packages check)
  39. #:use-module (gnu packages compression)
  40. #:use-module (gnu packages datastructures)
  41. #:use-module (gnu packages docbook)
  42. #:use-module (gnu packages flex)
  43. #:use-module (gnu packages fonts)
  44. #:use-module (gnu packages freedesktop)
  45. #:use-module (gnu packages fribidi)
  46. #:use-module (gnu packages gcc)
  47. #:use-module (gnu packages gettext)
  48. #:use-module (gnu packages ghostscript)
  49. #:use-module (gnu packages glib)
  50. #:use-module (gnu packages gnome)
  51. #:use-module (gnu packages gperf)
  52. #:use-module (gnu packages gtk)
  53. #:use-module (gnu packages image)
  54. #:use-module (gnu packages linux)
  55. #:use-module (gnu packages man)
  56. #:use-module (gnu packages perl)
  57. #:use-module (gnu packages pkg-config)
  58. #:use-module (gnu packages python)
  59. #:use-module (gnu packages python-xyz)
  60. #:use-module (gnu packages sqlite)
  61. #:use-module (gnu packages webkit)
  62. #:use-module (gnu packages xdisorg)
  63. #:use-module (gnu packages xml)
  64. #:use-module (gnu packages xorg)
  65. #:use-module (gnu packages tex)
  66. #:use-module ((guix licenses) #:prefix license:)
  67. #:use-module (guix packages)
  68. #:use-module (guix download)
  69. #:use-module (guix svn-download)
  70. #:use-module (guix git-download)
  71. #:use-module (guix build-system cmake)
  72. #:use-module (guix build-system gnu)
  73. #:use-module (guix build-system python)
  74. #:use-module (guix build-system meson)
  75. #:use-module (guix utils)
  76. #:use-module (srfi srfi-1))
  77. (define-public freetype
  78. (package
  79. (name "freetype")
  80. (version "2.10.4")
  81. (source
  82. (origin
  83. (method url-fetch)
  84. (uri (string-append "mirror://savannah/freetype/freetype-"
  85. version ".tar.xz"))
  86. (sha256
  87. (base32 "112pyy215chg7f7fmp2l9374chhhpihbh8wgpj5nj6avj3c59a46"))))
  88. (build-system gnu-build-system)
  89. (arguments
  90. ;; The use of "freetype-config" is deprecated, but other packages still
  91. ;; depend on it.
  92. `(#:configure-flags (list "--enable-freetype-config")))
  93. (native-inputs
  94. `(("pkg-config" ,pkg-config)))
  95. (propagated-inputs
  96. ;; These are all in the Requires.private field of freetype2.pc.
  97. ;; XXX: add harfbuzz.
  98. `(("libpng" ,libpng)
  99. ("zlib" ,zlib)))
  100. (synopsis "Font rendering library")
  101. (description
  102. "Freetype is a library that can be used by applications to access the
  103. contents of font files. It provides a uniform interface to access font files.
  104. It supports both bitmap and scalable formats, including TrueType, OpenType,
  105. Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
  106. anti-aliased glyph bitmap generation with 256 gray levels.")
  107. (license license:freetype) ; some files have other licenses
  108. (home-page "https://www.freetype.org/")))
  109. (define-public ttfautohint
  110. (package
  111. (name "ttfautohint")
  112. (version "1.8.3")
  113. (source
  114. (origin
  115. (method url-fetch)
  116. (uri (string-append "mirror://savannah/freetype/ttfautohint-"
  117. version ".tar.gz"))
  118. (sha256
  119. (base32
  120. "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7"))))
  121. (build-system gnu-build-system)
  122. (native-inputs
  123. `(("flex" ,flex)
  124. ("bison" ,bison)
  125. ("pkg-config" ,pkg-config)))
  126. (inputs
  127. `(("freetype" ,freetype)
  128. ("harfbuzz" ,harfbuzz)))
  129. (arguments
  130. `(#:configure-flags '("--disable-static"
  131. "--with-qt=no"))) ;no gui
  132. (synopsis "Automated font hinting")
  133. (description
  134. "ttfautohint provides a 99% automated hinting process and a platform for
  135. finely hand-hinting the last 1%. It is ideal for web fonts and supports many
  136. scripts.")
  137. (license (list license:gpl2+ license:freetype)) ;choose one or the other
  138. (home-page "https://www.freetype.org/ttfautohint/")))
  139. (define-public woff-tools
  140. (package
  141. (name "woff-tools")
  142. (version "2009.10.04")
  143. (source
  144. (origin
  145. (method url-fetch)
  146. ;; Upstream source is unversioned, so use Debian's versioned tarball
  147. (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
  148. "woff-tools_" version ".orig.tar.gz"))
  149. (file-name (string-append name "-" version ".tar.gz"))
  150. (sha256
  151. (base32
  152. "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
  153. (build-system gnu-build-system)
  154. (inputs
  155. `(("zlib" ,zlib)))
  156. (arguments
  157. `(#:make-flags '(,(string-append "CC=" (cc-for-target)))
  158. #:tests? #f ;no tests
  159. #:phases
  160. (modify-phases %standard-phases
  161. (delete 'configure) ;no configuration
  162. (replace 'install
  163. (lambda* (#:key outputs #:allow-other-keys)
  164. (let* ((out (assoc-ref outputs "out"))
  165. (bin (string-append out "/bin")))
  166. (install-file "sfnt2woff" bin)
  167. (install-file "woff2sfnt" bin))
  168. #t)))))
  169. (synopsis "Convert between OpenType and WOFF fonts")
  170. (description
  171. "This package provides two tools:
  172. @table @code
  173. @item sfnt2woff
  174. Converts OpenType fonts to WOFF fonts
  175. @item woff2sfnt
  176. Converts WOFF fonts to OpenType fonts
  177. @end table")
  178. (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
  179. (home-page "https://people.mozilla.com/~jkew/woff/")))
  180. (define-public ttf2eot
  181. (package
  182. (name "ttf2eot")
  183. (version "0.0.3")
  184. (source
  185. (origin
  186. (method git-fetch)
  187. (uri (git-reference
  188. (url "https://github.com/wget/ttf2eot")
  189. (commit (string-append "v" version))))
  190. (file-name (git-file-name name version))
  191. (sha256
  192. (base32
  193. "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
  194. (patches (list (search-patch "ttf2eot-cstddef.patch")))))
  195. (build-system gnu-build-system)
  196. (arguments
  197. `(#:tests? #f ; no tests
  198. #:phases
  199. (modify-phases %standard-phases
  200. (delete 'configure) ; no configuration
  201. (replace 'install ; no install target
  202. (lambda* (#:key outputs #:allow-other-keys)
  203. (let* ((out (assoc-ref outputs "out"))
  204. (bin (string-append out "/bin")))
  205. (install-file "ttf2eot" bin)
  206. #t))))))
  207. (synopsis "Convert from TrueType to Embeddable Open Type")
  208. (description
  209. "This package contains a commandline wrapper around OpenTypeUtilities.cpp
  210. from Chromium, used to make EOT (Embeddable Open Type) files from
  211. TTF (TrueType/OpenType Font) files.")
  212. ;; While the README states "License: Derived from WebKit, so BSD/LGPL
  213. ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
  214. ;; license header, and the wrapper source contains no license header.
  215. (license license:bsd-2)
  216. (home-page "https://github.com/wget/ttf2eot")))
  217. (define-public ttf2pt1
  218. (package
  219. (name "ttf2pt1")
  220. (version "3.4.4")
  221. (source (origin
  222. (method url-fetch)
  223. (uri (string-append "mirror://sourceforge/ttf2pt1/ttf2pt1/"
  224. version "/ttf2pt1-" version ".tgz"))
  225. (sha256
  226. (base32
  227. "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf"))
  228. (modules '((guix build utils)))
  229. (snippet
  230. '(begin
  231. ;; Remove trailing backslashes in the sed expression of the
  232. ;; 'install' rule since sed would otherwise fail.
  233. (substitute* "Makefile"
  234. (("\\|;\\\\[[:space:]]*$") "|; "))
  235. #t))))
  236. (build-system gnu-build-system)
  237. (arguments
  238. '(#:tests? #f ;no tests
  239. #:phases (modify-phases %standard-phases
  240. (replace 'configure
  241. (lambda* (#:key outputs #:allow-other-keys)
  242. (let ((out (assoc-ref outputs "out")))
  243. (substitute* "Makefile"
  244. (("INSTDIR =.*")
  245. (string-append "INSTDIR = " out "\n"))
  246. (("OWNER = .*")
  247. "OWNER = `id -un`\n")
  248. (("GROUP = .*")
  249. "GROUP = `id -g`\n"))
  250. #t)))
  251. (replace 'build
  252. (lambda _
  253. (invoke "make" "-j"
  254. (number->string (parallel-job-count))
  255. "all" "CC=gcc"))))))
  256. (inputs `(("perl" ,perl)))
  257. (synopsis "Convert TrueType fonts to Postscript Type 1")
  258. (description
  259. "TTF2PT1 provides tools to convert most TrueType fonts (or other formats
  260. supported by the FreeType library) to an Adobe Type 1 @file{.pfa} or
  261. @file{.pfb} file. Another use is as a hinting engine: feed it an unhinted or
  262. poorly hinted Adobe Type 1 font through the FreeType library and get it back
  263. with freshly generated hints. The files produced by default are in
  264. human-readable form, which further needs to be encoded with t1utilities to
  265. work with most software requiring Type 1 fonts.")
  266. (home-page "http://ttf2pt1.sourceforge.net/")
  267. (license license:bsd-3)))
  268. (define-public woff2
  269. (package
  270. (name "woff2")
  271. (version "1.0.2")
  272. (source
  273. (origin
  274. (method git-fetch)
  275. (uri
  276. (git-reference
  277. (url "https://github.com/google/woff2")
  278. (commit (string-append "v" version))))
  279. (file-name
  280. (git-file-name name version))
  281. (sha256
  282. (base32 "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y"))))
  283. (build-system cmake-build-system)
  284. (outputs '("out" "bin"))
  285. (arguments
  286. `(#:tests? #f ; No target
  287. #:configure-flags
  288. (list
  289. (string-append "-DCMAKE_INSTALL_BINDIR="
  290. (assoc-ref %outputs "bin")
  291. "/bin")
  292. (string-append "-DCMAKE_INSTALL_INCLUDEDIR="
  293. (assoc-ref %outputs "out")
  294. "/include")
  295. (string-append "-DCMAKE_INSTALL_LIBDIR="
  296. (assoc-ref %outputs "out")
  297. "/lib"))
  298. #:phases
  299. (modify-phases %standard-phases
  300. ;; To install both binaries and libraries.
  301. (add-after 'unpack 'patch-installation
  302. (lambda _
  303. (substitute* "CMakeLists.txt"
  304. (("NOT BUILD_SHARED_LIBS")
  305. "BUILD_SHARED_LIBS"))
  306. #t)))))
  307. (native-inputs
  308. `(("pkg-config" ,pkg-config)))
  309. (inputs
  310. `(("brotli" ,google-brotli)))
  311. (synopsis "Libraries and tools for WOFF2 font format")
  312. (description "WOFF2 provides libraries and tools to handle the Web Open
  313. Font Format (WOFF).")
  314. (home-page "https://w3c.github.io/woff/woff2/")
  315. (license license:expat)))
  316. (define-public fontconfig
  317. (hidden-package
  318. (package
  319. (name "fontconfig-minimal")
  320. (version "2.13.94")
  321. (source (origin
  322. (method url-fetch)
  323. (uri (string-append
  324. "https://www.freedesktop.org/software/"
  325. "fontconfig/release/fontconfig-" version ".tar.xz"))
  326. (sha256
  327. (base32
  328. "0g004r0bkkqz00mpm3svnnxn7d83158q0yb9ggxryizxfg5m5w55"))
  329. (patches (search-patches "fontconfig-cache-ignore-mtime.patch"))))
  330. (build-system gnu-build-system)
  331. ;; In Requires or Requires.private of fontconfig.pc.
  332. (propagated-inputs `(("expat" ,expat)
  333. ("freetype" ,freetype)
  334. ("libuuid" ,util-linux "lib")))
  335. (inputs
  336. ;; We use to use 'font-ghostscript' but they are not recognized by newer
  337. ;; versions of Pango, causing many applications to fail to find fonts
  338. ;; otherwise.
  339. `(("font-dejavu" ,font-dejavu)))
  340. (native-inputs
  341. `(("gperf" ,gperf)
  342. ("pkg-config" ,pkg-config)
  343. ("python" ,python-minimal))) ;to avoid a cycle through tk
  344. (arguments
  345. `(#:configure-flags
  346. (list "--disable-docs"
  347. "--with-cache-dir=/var/cache/fontconfig"
  348. ;; register the default fonts
  349. (string-append "--with-default-fonts="
  350. (assoc-ref %build-inputs "font-dejavu")
  351. "/share/fonts")
  352. ;; Register fonts from user and system profiles.
  353. (string-append "--with-add-fonts="
  354. "~/.guix-profile/share/fonts,"
  355. "/run/current-system/profile/share/fonts"))
  356. #:phases
  357. (modify-phases %standard-phases
  358. (add-before 'check 'skip-problematic-tests
  359. (lambda _
  360. ;; SOURCE_DATE_EPOCH doesn't make sense when ignoring mtime
  361. (unsetenv "SOURCE_DATE_EPOCH")
  362. (substitute* "test/run-test.sh"
  363. ;; The crbug1004254 test attempts to fetch fonts from the
  364. ;; network.
  365. (("\\[ -x \"\\$BUILDTESTDIR\"/test-crbug1004254 \\]")
  366. "false"))))
  367. (replace 'install
  368. (lambda _
  369. ;; Don't try to create /var/cache/fontconfig.
  370. (invoke "make" "install"
  371. "fc_cachedir=$(TMPDIR)"
  372. "RUN_FC_CACHE_TEST=false"))))))
  373. (synopsis "Library for configuring and customizing font access")
  374. (description
  375. "Fontconfig can discover new fonts when installed automatically;
  376. perform font name substitution, so that appropriate alternative fonts can
  377. be selected if fonts are missing;
  378. identify the set of fonts required to completely cover a set of languages;
  379. have GUI configuration tools built as it uses an XML-based configuration file;
  380. efficiently and quickly find needed fonts among the set of installed fonts;
  381. be used in concert with the X Render Extension and FreeType to implement
  382. high quality, anti-aliased and subpixel rendered text on a display.")
  383. ; The exact license is more X11-style than BSD-style.
  384. (license (license:non-copyleft "file://COPYING"
  385. "See COPYING in the distribution."))
  386. (home-page "https://www.freedesktop.org/wiki/Software/fontconfig"))))
  387. ;;; The documentation of fontconfig is built in a separate package, as it
  388. ;;; causes a dramatic increase in the size of the closure of fontconfig. This
  389. ;;; is intentionally named 'fontconfig', as it's intended as the user-facing
  390. ;;; fontconfig package.
  391. (define-public fontconfig-with-documentation
  392. (package
  393. (inherit fontconfig)
  394. (name "fontconfig")
  395. (outputs (cons "doc" (package-outputs fontconfig)))
  396. (arguments
  397. (substitute-keyword-arguments (package-arguments fontconfig)
  398. ((#:configure-flags configure-flags)
  399. `(delete "--disable-docs" ,configure-flags))
  400. ((#:phases phases '%standard-phases)
  401. `(modify-phases ,phases
  402. (add-after 'unpack 'no-pdf-doc
  403. (lambda _
  404. ;; Don't build documentation as PDF.
  405. (substitute* "doc/Makefile.in"
  406. (("^PDF_FILES = .*")
  407. "PDF_FILES =\n"))))
  408. (add-after 'install 'move-man-sections
  409. (lambda* (#:key outputs #:allow-other-keys)
  410. ;; Move share/man/man{3,5} to the "doc" output. Leave "man1" in
  411. ;; "out" for convenience.
  412. (let ((out (assoc-ref outputs "out"))
  413. (doc (assoc-ref outputs "doc")))
  414. (for-each (lambda (section)
  415. (let ((source (string-append out "/share/man/"
  416. section))
  417. (target (string-append doc "/share/man/"
  418. section)))
  419. (copy-recursively source target)
  420. (delete-file-recursively source)))
  421. '("man3" "man5")))))))))
  422. (native-inputs
  423. (append (package-native-inputs fontconfig)
  424. `(("docbook-utils" ,docbook-utils))))
  425. (properties (alist-delete 'hidden? (package-properties fontconfig)))))
  426. (define-public t1lib
  427. (package
  428. (name "t1lib")
  429. (version "5.1.2")
  430. (source (origin
  431. (method url-fetch)
  432. (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
  433. "graphics/" name "-" version ".tar.gz")
  434. (string-append "https://fossies.org/linux/misc/old/"
  435. name "-" version ".tar.gz")))
  436. (sha256 (base32
  437. "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
  438. (patches (search-patches
  439. "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
  440. "t1lib-CVE-2011-0764.patch"
  441. "t1lib-CVE-2011-1552+.patch")))) ; 2011-1553, 2011-1554
  442. (properties `((lint-hidden-cve . ("CVE-2011-0433"
  443. "CVE-2011-1553"
  444. "CVE-2011-1554"
  445. "CVE-2011-5244"))))
  446. (build-system gnu-build-system)
  447. (arguments
  448. ;; Making the documentation requires latex, but t1lib is also an input
  449. ;; for building texlive.
  450. `(#:tests? #f ; no test target
  451. #:make-flags
  452. '("without_doc")))
  453. (synopsis "Library for generating bitmaps from Type 1 fonts")
  454. (description
  455. "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
  456. It is based on the code of the X11 rasteriser of the X11 project.
  457. The bitmaps created by t1lib are returned in a data structure with type
  458. GLYPH. This special GLYPH-type is also used in the X11 window system to
  459. describe character bitmaps. It contains the bitmap data as well as some
  460. metric information. But t1lib is in itself entirely independent of the
  461. X11-system or any other graphical user interface.")
  462. (license license:gpl2)
  463. (home-page "https://www.t1lib.org/")))
  464. (define-public teckit
  465. (package
  466. (name "teckit")
  467. (version "2.5.10") ; signed by key 0xC9183BEA0288CDEE
  468. (source
  469. (origin
  470. (method url-fetch)
  471. (uri (string-append "https://github.com/silnrsi/teckit/releases/"
  472. "download/v" version "/teckit-" version ".tar.gz"))
  473. (sha256
  474. (base32 "12qnf8nhxyr4d5pc01s3vc6h726506957an4vvmmfz633cqi5796"))))
  475. (build-system gnu-build-system)
  476. (arguments
  477. '(#:configure-flags '("--disable-static")))
  478. (inputs
  479. `(("zlib" ,zlib)
  480. ("expat" ,expat)))
  481. (native-inputs
  482. `(("perl" ,perl))) ;for the tests
  483. (synopsis "Toolkit for encoding conversions")
  484. (description
  485. "TECkit is a low-level toolkit intended to be used by other applications
  486. that need to perform encoding conversions (e.g., when importing legacy data
  487. into a Unicode-based application). The primary component of the TECkit
  488. package is therefore a library that performs conversions; this is the
  489. \"TECkit engine\". The engine relies on mapping tables in a specific binary
  490. format (for which documentation is available); there is a compiler that
  491. creates such tables from a human-readable mapping description (a simple
  492. text file).
  493. To facilitate the development and testing of mapping tables for TECkit,
  494. several applications are also included in the current package; these
  495. include simple tools for applying conversions to plain-text and Standard
  496. Format files, as well as both command-line and simple GUI versions of the
  497. TECkit compiler. However, it is not intended that these tools will be the
  498. primary means by which end users perform conversions, and they have not
  499. been designed, tested, and debugged to the extent that general-purpose
  500. applications should be.")
  501. (license license:lgpl2.1+)
  502. (home-page "https://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
  503. (define-public graphite2
  504. (package
  505. (name "graphite2")
  506. (version "1.3.13")
  507. (source
  508. (origin
  509. (method url-fetch)
  510. (uri (string-append "https://github.com/silnrsi/graphite/releases/"
  511. "download/" version "/" name "-" version ".tgz"))
  512. (sha256
  513. (base32
  514. "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx"))))
  515. (build-system cmake-build-system)
  516. (native-inputs
  517. `(("python" ,python)
  518. ("python-fonttools" ,python-fonttools)))
  519. (inputs
  520. `(("freetype" ,freetype)))
  521. (synopsis "Reimplementation of the SIL Graphite text processing engine")
  522. (description
  523. "Graphite2 is a reimplementation of the SIL Graphite text processing
  524. engine. Graphite is a smart font technology designed to facilitate the
  525. process known as shaping. This process takes an input Unicode text string
  526. and returns a sequence of positioned glyphids from the font.")
  527. (license license:lgpl2.1+)
  528. (home-page "https://github.com/silnrsi/graphite")))
  529. (define-public potrace
  530. (package
  531. (name "potrace")
  532. (version "1.16")
  533. (source
  534. (origin
  535. (method url-fetch)
  536. (uri (string-append "mirror://sourceforge/potrace/" version
  537. "/potrace-" version ".tar.gz"))
  538. (sha256
  539. (base32
  540. "1k3sxgjqq0jnpk9xxys05q32sl5hbf1lbk1gmfxcrmpdgnhli0my"))))
  541. (build-system gnu-build-system)
  542. (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
  543. (inputs `(("zlib" ,zlib)))
  544. (arguments
  545. `(#:configure-flags
  546. `("--with-libpotrace"))) ; install library and headers
  547. (synopsis "Transform bitmaps into vector graphics")
  548. (description
  549. "Potrace is a tool for tracing a bitmap, which means, transforming a
  550. bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
  551. or BMP format), and the default output is an encapsulated PostScript
  552. file (EPS). A typical use is to create EPS files from scanned data, such as
  553. company or university logos, handwritten notes, etc. The resulting image is
  554. not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
  555. resolution.")
  556. (license license:gpl2+)
  557. (home-page "http://potrace.sourceforge.net/")))
  558. (define-public libotf
  559. (package
  560. (name "libotf")
  561. (version "0.9.16")
  562. (source (origin
  563. (method url-fetch)
  564. (uri (string-append "mirror://savannah/m17n/libotf-"
  565. version ".tar.gz"))
  566. (sha256
  567. (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
  568. (build-system gnu-build-system)
  569. (native-inputs
  570. `(("pkg-config" ,pkg-config)))
  571. (propagated-inputs
  572. `(("freetype" ,freetype)))
  573. (home-page "https://www.nongnu.org/m17n/")
  574. (synopsis "Library for handling OpenType Font")
  575. (description "This library can read Open Type Layout Tables from an OTF
  576. file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
  577. GPOS. It can convert a Unicode character sequence to a glyph code sequence by
  578. using the above tables.")
  579. (license license:lgpl2.0+)))
  580. (define-public libspiro
  581. (package
  582. (name "libspiro")
  583. (version "20200505")
  584. (source
  585. (origin
  586. (method url-fetch)
  587. (uri (string-append "https://github.com/fontforge/libspiro/releases"
  588. "/download/" version "/libspiro-dist-" version ".tar.gz"))
  589. (sha256
  590. (base32
  591. "0j8fmyj4wz6mqk17dqs6f8jx0i52n68gv5px17qbrjnbilg9mih6"))))
  592. (build-system gnu-build-system)
  593. (arguments
  594. '(#:configure-flags '("--disable-static")))
  595. (synopsis "Clothoid to bezier conversion library")
  596. (description
  597. "Raph Levien's Spiro package as a library. A mechanism for drawing
  598. smooth contours with constant curvature at the spline joins.")
  599. (license license:gpl2+)
  600. (home-page "http://libspiro.sourceforge.net/")))
  601. (define-public libuninameslist
  602. (package
  603. (name "libuninameslist")
  604. (version "20200313")
  605. (home-page "https://github.com/fontforge/libuninameslist")
  606. (source
  607. (origin
  608. (method url-fetch)
  609. (uri (string-append home-page "/releases/download/" version
  610. "/libuninameslist-dist-" version ".tar.gz"))
  611. (sha256
  612. (base32
  613. "10ri80c64xb4rhbif3sr87y5vhi3m702zb0m02imvj1jib9rq0m8"))))
  614. (build-system gnu-build-system)
  615. (synopsis "Unicode names and annotation list")
  616. (description
  617. "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
  618. useful for programs that need Unicode \"Names\", \"Annotations\", and block
  619. definitions.")
  620. ;; COPYING specifies GPL2, but according to LICENSE it only covers the
  621. ;; configure script. The actual code is BSD-3, and the Unicode data
  622. ;; is governed by an X11-style license only found on the web.
  623. (license (list license:bsd-3
  624. (license:x11-style
  625. "https://www.unicode.org/copyright.html#License")))))
  626. (define-public fontforge
  627. (package
  628. (name "fontforge")
  629. (version "20201107")
  630. (source (origin
  631. (method url-fetch)
  632. (uri (string-append
  633. "https://github.com/fontforge/fontforge/releases/download/"
  634. version "/fontforge-" version ".tar.xz"))
  635. (sha256
  636. (base32 "0y3c8x1i6yf6ak9m5dhr1nldgfmg7zhnwdfd57ffs698c27vmg38"))))
  637. (build-system cmake-build-system)
  638. (native-inputs
  639. `(("pkg-config" ,pkg-config)))
  640. (inputs `(("cairo" ,cairo)
  641. ("fontconfig" ,fontconfig) ;dlopen'd
  642. ("freetype" ,freetype)
  643. ("gettext" ,gettext-minimal)
  644. ("libICE" ,libice)
  645. ("libSM" ,libsm)
  646. ("libX11" ,libx11)
  647. ("libXi" ,libxi)
  648. ("libjpeg" ,libjpeg-turbo)
  649. ("libltdl" ,libltdl)
  650. ("libpng" ,libpng)
  651. ("libspiro" ,libspiro)
  652. ("libtiff" ,libtiff)
  653. ("libungif" ,libungif)
  654. ("libuninameslist" ,libuninameslist)
  655. ("libxft" ,libxft)
  656. ("libxml2" ,libxml2)
  657. ("pango" ,pango)
  658. ("potrace" ,potrace)
  659. ("python" ,python)
  660. ("zlib" ,zlib)))
  661. (arguments
  662. '(#:configure-flags '(;; TODO: Provide GTK+ for the Wayland-friendly GDK
  663. ;; backend, instead of the legacy X11 backend.
  664. ;; Currently it introduces a circular dependency.
  665. "-DENABLE_X11=ON")
  666. #:phases
  667. (modify-phases %standard-phases
  668. (add-after 'unpack 'do-not-override-RPATH
  669. (lambda _
  670. ;; Do not attempt to set a default RPATH, as our ld-wrapper
  671. ;; already does the right thing.
  672. (substitute* "CMakeLists.txt"
  673. (("^set_default_rpath\\(\\)")
  674. ""))
  675. #t))
  676. (add-after 'install 'set-library-path
  677. (lambda* (#:key inputs outputs #:allow-other-keys)
  678. (let ((out (assoc-ref outputs "out"))
  679. (potrace (dirname
  680. (search-input-file inputs "bin/potrace"))))
  681. (wrap-program (string-append out "/bin/fontforge")
  682. ;; Fontforge dynamically opens libraries.
  683. `("LD_LIBRARY_PATH" ":" prefix
  684. ,(map (lambda (input)
  685. (string-append (assoc-ref inputs input)
  686. "/lib"))
  687. '("libtiff" "libjpeg" "libpng" "libungif"
  688. "libxml2" "zlib" "libspiro" "freetype"
  689. "pango" "cairo" "fontconfig")))
  690. ;; Checks for potrace program at runtime
  691. `("PATH" ":" prefix (,potrace)))
  692. #t))))))
  693. (synopsis "Outline font editor")
  694. (description
  695. "FontForge allows you to create and modify postscript, truetype and
  696. opentype fonts. You can save fonts in many different outline formats, and
  697. generate bitmaps.")
  698. (license license:gpl3+)
  699. (home-page "https://fontforge.github.io")))
  700. ;; This is the last version that supports Python 2, which is needed for
  701. ;; GNU FreeFont. Remove once no longer required.
  702. (define-public fontforge-20190801
  703. (package
  704. (inherit fontforge)
  705. (version "20190801")
  706. (source (origin
  707. (method url-fetch)
  708. (uri (string-append
  709. "https://github.com/fontforge/fontforge/releases/download/"
  710. version "/fontforge-" version ".tar.gz"))
  711. (sha256
  712. (base32 "0lh8yx01asbzxm6car5cfi64njh5p4lxc7iv8dldr5rwg357a86r"))))
  713. (build-system gnu-build-system)
  714. (arguments
  715. (substitute-keyword-arguments (package-arguments fontforge)
  716. ((#:configure-flags _)
  717. ''())
  718. ((#:phases phases)
  719. `(modify-phases ,phases
  720. (delete 'do-not-override-RPATH)))))
  721. (inputs
  722. `(("python" ,python-2)
  723. ,@(alist-delete "python" (package-inputs fontforge))))))
  724. (define-public python2-ufolib
  725. (package
  726. (name "python2-ufolib")
  727. (version "2.1.1")
  728. (source
  729. (origin
  730. (method url-fetch)
  731. (uri (pypi-uri "ufoLib" version ".zip"))
  732. (sha256
  733. (base32 "07qy6mx7z0wi9a30lc2hj5i9q1gnz1n8l40dmjz2c19mj9s6mz9l"))))
  734. (build-system python-build-system)
  735. (arguments
  736. `(#:python ,python-2))
  737. (propagated-inputs
  738. `(("python2-fonttools" ,python2-fonttools)))
  739. (native-inputs
  740. `(("unzip" ,unzip)
  741. ("python2-pytest" ,python2-pytest)
  742. ("python2-pytest-runner" ,python2-pytest-runner)))
  743. (home-page "https://github.com/unified-font-object/ufoLib")
  744. (synopsis "Low-level UFO reader and writer")
  745. (description
  746. "UfoLib reads and writes Unified Font Object (UFO)
  747. files. UFO is a file format that stores fonts source files.")
  748. (license license:bsd-3)))
  749. (define-public python2-defcon
  750. (package
  751. (name "python2-defcon")
  752. (version "0.3.5")
  753. (source
  754. (origin
  755. (method url-fetch)
  756. (uri (pypi-uri "defcon" version ".zip"))
  757. (sha256
  758. (base32
  759. "03jlm2gy9lvbwj68kfdm43yaddwd634jwkdg4wf0jxx2s8mwbg22"))))
  760. (build-system python-build-system)
  761. (arguments
  762. `(#:python ,python-2))
  763. (native-inputs
  764. `(("unzip" ,unzip)
  765. ("python2-pytest" ,python2-pytest)
  766. ("python2-pytest-runner" ,python2-pytest-runner)))
  767. (propagated-inputs
  768. `(("python2-fonttools" ,python2-fonttools)
  769. ("python2-ufolib" ,python2-ufolib)))
  770. (home-page "https://pypi.org/project/defcon/")
  771. (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data")
  772. (description
  773. "Defcon is a set of @acronym{UFO, unified font object} based objects
  774. optimized for use in font editing applications. The objects are built to
  775. be lightweight, fast and flexible. The objects are very bare-bones and
  776. they are not meant to be end-all, be-all objects. Rather, they are meant
  777. to provide base functionality so that you can focus on your application’s
  778. behavior, not object observing or maintaining cached data. Defcon
  779. implements UFO3 as described by the UFO font format.")
  780. (license license:expat)))
  781. (define-public nototools
  782. (package
  783. (name "nototools")
  784. (version "20170925")
  785. (source
  786. (origin
  787. (method git-fetch)
  788. (uri (git-reference
  789. (url "https://github.com/googlei18n/nototools")
  790. (commit "v2017-09-25-tooling-for-phase3-update")))
  791. (file-name (git-file-name name version))
  792. (sha256
  793. (base32
  794. "03nzvcvwmrhfrcjhg218q2f3hfrm3vlivp4rk19sc397kh3hisiz"))))
  795. (build-system python-build-system)
  796. (arguments
  797. `(#:python ,python-2))
  798. (propagated-inputs
  799. `(("python2-booleanoperations" ,python2-booleanoperations)
  800. ("python2-defcon" ,python2-defcon)
  801. ("python2-fonttools" ,python2-fonttools)
  802. ("python2-pillow" ,python2-pillow)
  803. ("python2-pyclipper" ,python2-pyclipper)
  804. ("python2-ufolib" ,python2-ufolib)))
  805. (home-page "https://github.com/googlei18n/nototools")
  806. (synopsis "Noto fonts support tools and scripts")
  807. (description
  808. "Nototools is a Python package containing Python scripts used to
  809. maintain the Noto Fonts project.")
  810. (license (list license:asl2.0
  811. ;; Sample texts are attributed to UN and OHCHR.
  812. ;; The permissions on the UDHR are pretty lax:
  813. ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
  814. ;; "If UDHR translations or materials are reproduced, users
  815. ;; should make reference to this website as a source by
  816. ;; providing a link."
  817. license:public-domain
  818. (license:non-copyleft
  819. "file://sample_texts/attributions.txt"
  820. "See sample_texts/attributions.txt in the distribution.")))))
  821. (define-public fcft
  822. (package
  823. (name "fcft")
  824. (version "2.4.1")
  825. (home-page "https://codeberg.org/dnkl/fcft")
  826. (source (origin
  827. (method git-fetch)
  828. (uri (git-reference (url home-page) (commit version)))
  829. (file-name (git-file-name name version))
  830. (sha256
  831. (base32
  832. "00rwh5qfayihrq0wjx8pxqw5ah6g5ym6raxvdbqb6g6rk7m2j423"))))
  833. (build-system meson-build-system)
  834. (native-inputs
  835. `(("check" ,check)
  836. ("gcc" ,gcc-10) ;TODO: Remove when the default compiler is > GCC 7.
  837. ("pkg-config" ,pkg-config)
  838. ("scdoc" ,scdoc)))
  839. (propagated-inputs
  840. `(;; Required by fcft.pc.
  841. ("fontconfig" ,fontconfig)
  842. ("freetype" ,freetype)
  843. ("harfbuzz" ,harfbuzz)
  844. ("pixman" ,pixman)
  845. ("tllist" ,tllist)))
  846. (synopsis "Font loading and glyph rasterization library")
  847. (description
  848. "@code{fcft} is a small font loading and glyph rasterization library
  849. built on-top of FontConfig, FreeType2 and pixman.
  850. It can load and cache fonts from a fontconfig-formatted name string, e.g.
  851. @code{Monospace:size=12}, optionally with user configured fallback fonts.
  852. After a font has been loaded, you can rasterize glyphs. When doing so, the
  853. primary font is first considered. If it does not have the requested glyph,
  854. the user configured fallback fonts (if any) are considered. If none of the
  855. user configured fallback fonts has the requested glyph, the FontConfig
  856. generated list of fallback fonts are checked.")
  857. ;; The code is distributed under the Expat license, but embeds Unicode
  858. ;; data files carrying the Unicode license.
  859. (license (list license:expat license:unicode))))
  860. (define-public fontmanager
  861. (package
  862. (name "fontmanager")
  863. (version "0.8.4")
  864. (source
  865. (origin
  866. (method git-fetch)
  867. (uri (git-reference
  868. (url "https://github.com/FontManager/font-manager")
  869. (commit version)))
  870. (file-name (git-file-name name version))
  871. (sha256
  872. (base32
  873. "09rv0srpj8ann2n1zpv1frlpxz0x10d2y21c5lys7pmfngljlxi9"))))
  874. (build-system meson-build-system)
  875. (arguments
  876. `(#:glib-or-gtk? #t
  877. #:build-type "release"
  878. #:configure-flags
  879. (list (string-append "-Dc_link_args=-Wl,-rpath="
  880. (assoc-ref %outputs "out")
  881. "/lib/font-manager"))))
  882. (native-inputs
  883. `(("desktop-file-utils" ,desktop-file-utils)
  884. ("gettext" ,gettext-minimal)
  885. ("glib" ,glib "bin")
  886. ("gobject-introspection" ,gobject-introspection)
  887. ("pkg-config" ,pkg-config)
  888. ("vala" ,vala)
  889. ("yelp-tools" ,yelp-tools)))
  890. (inputs
  891. `(("fonconfig" ,fontconfig)
  892. ("freetype" ,freetype)
  893. ("gtk+" ,gtk+)
  894. ("json-glib" ,json-glib)
  895. ("libsoup" ,libsoup)
  896. ("sqlite" ,sqlite)
  897. ("webkitgtk" ,webkitgtk)))
  898. (home-page "https://fontmanager.github.io/")
  899. (synopsis "Simple font management for GTK+ desktop environments")
  900. (description "Font Manager is intended to provide a way for users to
  901. easily manage desktop fonts, without having to resort to command-line
  902. tools or editing configuration files by hand.
  903. While designed primarily with the GNOME Desktop Environment in mind, it should
  904. work well with other GTK+ desktop environments.")
  905. (license license:gpl3+)))
  906. (define-public fntsample
  907. (package
  908. (name "fntsample")
  909. (version "5.3")
  910. (source (origin
  911. (method git-fetch)
  912. (uri (git-reference
  913. (url "https://github.com/eugmes/fntsample")
  914. (commit (string-append "release/" version))))
  915. (file-name (git-file-name name version))
  916. (sha256
  917. (base32
  918. "02rx3gp7k472304vhjwb129nw10a29s4nvgs7i2m6bpjhlk2xgs5"))))
  919. (build-system cmake-build-system)
  920. (arguments
  921. `(#:tests? #f ; There are no tests.
  922. #:configure-flags
  923. (list (string-append
  924. "-DUNICODE_BLOCKS=" (assoc-ref %build-inputs "unicode-blocks")))
  925. #:phases
  926. (modify-phases %standard-phases
  927. (add-after 'install 'set-library-path
  928. (lambda* (#:key inputs outputs #:allow-other-keys)
  929. (let* ((out (assoc-ref outputs "out"))
  930. (pdf-api2 (assoc-ref inputs "perl-pdf-api2"))
  931. (intl (assoc-ref inputs "perl-libintl-perl"))
  932. (perllib (string-append pdf-api2
  933. "/lib/perl5/site_perl/"
  934. ,(package-version perl)
  935. ":" intl
  936. "/lib/perl5/site_perl/"
  937. ,(package-version perl))))
  938. (wrap-program (string-append out "/bin/pdfoutline")
  939. `("PERL5LIB" ":" prefix (,perllib)))
  940. #t))))))
  941. (native-inputs
  942. `(("pkg-config" ,pkg-config)
  943. ("gettext" ,gettext-minimal)))
  944. (inputs
  945. `(("cairo" ,cairo)
  946. ("fontconfig" ,fontconfig)
  947. ("freetype" ,freetype)
  948. ("glib" ,glib)
  949. ("pango" ,pango)
  950. ("perl-pdf-api2" ,perl-pdf-api2)
  951. ("perl-libintl-perl" ,perl-libintl-perl)
  952. ("unicode-blocks"
  953. ,(origin
  954. (method url-fetch)
  955. (uri "https://unicode.org/Public/UNIDATA/Blocks.txt")
  956. (file-name "unicode-blocks.txt")
  957. (sha256
  958. (base32
  959. "1xs8fnhh48gs41wg004r7m4r2azh9khmyjjlnvyzy9c6zrd212x2"))))))
  960. (home-page "https://github.com/eugmes/fntsample")
  961. (synopsis "PDF and PostScript font samples generator")
  962. (description "This package provides a tool that can be used to make font
  963. samples that show coverage of the font and are similar in appearance to
  964. Unicode Charts. It was developed for use with DejaVu Fonts project.")
  965. (license license:gpl3+)))
  966. (define-public libraqm
  967. (package
  968. (name "libraqm")
  969. (version "0.7.1")
  970. (source
  971. (origin
  972. (method url-fetch)
  973. (uri (string-append "https://github.com/HOST-Oman/libraqm/"
  974. "releases/download/v" version "/"
  975. "raqm-" version ".tar.gz"))
  976. (sha256
  977. (base32 "0a4q9dziirb85sa9rmkamg2krdhd009di2vlz91njwxcp3q8qj46"))))
  978. (build-system gnu-build-system)
  979. (arguments
  980. `(#:configure-flags (list "--disable-static")))
  981. (native-inputs
  982. `(("gtk-doc" ,gtk-doc/stable)
  983. ("pkg-config" ,pkg-config)
  984. ("python" ,python-wrapper)))
  985. (inputs
  986. `(("freetype" ,freetype)
  987. ("fribidi" ,fribidi)
  988. ("harfbuzz" ,harfbuzz)))
  989. (home-page "https://github.com/HOST-Oman/libraqm")
  990. (synopsis "Library for complex text layout")
  991. (description
  992. "Raqm is a small library that encapsulates the logic for complex text
  993. layout and provides a convenient API.
  994. It currently provides bidirectional text support (using FriBiDi),
  995. shaping (using HarfBuzz), and proper script itemization. As a result, Raqm
  996. can support most writing systems covered by Unicode.")
  997. (license license:expat)))
  998. (define-public lcdf-typetools
  999. (package
  1000. (name "lcdf-typetools")
  1001. (version "2.108")
  1002. (source (origin
  1003. (method git-fetch)
  1004. (uri (git-reference
  1005. (url "https://github.com/kohler/lcdf-typetools")
  1006. (commit (string-append "v" version))))
  1007. (file-name (git-file-name name version))
  1008. (sha256
  1009. (base32
  1010. "0a6jqaqwq43ldjjjlnsh6mczs2la9363qav7v9fyrfzkfj8kw9ad"))))
  1011. (build-system gnu-build-system)
  1012. (arguments
  1013. `(#:configure-flags
  1014. ;; This is only provided by the monolithic texlive distribution.
  1015. ;; FIXME: texlive-kpathsea doesn't come with the library and headers
  1016. (list "--without-kpathsea")))
  1017. (native-inputs
  1018. `(("autoconf" ,autoconf)
  1019. ("automake" ,automake)))
  1020. (home-page "https://lcdf.org/type/")
  1021. (synopsis "Multiple font manipulation tools")
  1022. (description "LCDF Typetools comprises several programs for manipulating
  1023. PostScript Type 1, Type 1 Multiple Master, OpenType, and TrueType fonts.
  1024. These tools are cfftot1, mmafm, mmpfb, otfinfo, otftotfm, t1dotlessj, t1lint,
  1025. t1rawfm, t1reencode, t1testpage and ttftotype42.")
  1026. (license license:gpl2+)))