fontutils.scm 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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 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 Nils Gillmann <ng0@n0.is>
  9. ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  11. ;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
  12. ;;;
  13. ;;; This file is part of GNU Guix.
  14. ;;;
  15. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  16. ;;; under the terms of the GNU General Public License as published by
  17. ;;; the Free Software Foundation; either version 3 of the License, or (at
  18. ;;; your option) any later version.
  19. ;;;
  20. ;;; GNU Guix is distributed in the hope that it will be useful, but
  21. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  22. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. ;;; GNU General Public License for more details.
  24. ;;;
  25. ;;; You should have received a copy of the GNU General Public License
  26. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  27. (define-module (gnu packages fontutils)
  28. #:use-module (gnu packages)
  29. #:use-module (gnu packages compression)
  30. #:use-module (gnu packages check)
  31. #:use-module (gnu packages ghostscript)
  32. #:use-module (gnu packages linux)
  33. #:use-module (gnu packages perl)
  34. #:use-module (gnu packages pkg-config)
  35. #:use-module (gnu packages autotools)
  36. #:use-module (gnu packages gettext)
  37. #:use-module (gnu packages python)
  38. #:use-module (gnu packages python-xyz)
  39. #:use-module (gnu packages image)
  40. #:use-module (gnu packages bison)
  41. #:use-module (gnu packages flex)
  42. #:use-module (gnu packages glib)
  43. #:use-module (gnu packages gperf)
  44. #:use-module (gnu packages xorg)
  45. #:use-module (gnu packages gtk)
  46. #:use-module (gnu packages xml)
  47. #:use-module ((guix licenses) #:prefix license:)
  48. #:use-module (guix packages)
  49. #:use-module (guix download)
  50. #:use-module (guix svn-download)
  51. #:use-module (guix git-download)
  52. #:use-module (guix build-system cmake)
  53. #:use-module (guix build-system gnu)
  54. #:use-module (guix build-system python))
  55. (define-public freetype
  56. (package
  57. (name "freetype")
  58. (version "2.9.1")
  59. (source (origin
  60. (method url-fetch)
  61. (uri (string-append "mirror://savannah/freetype/freetype-"
  62. version ".tar.bz2"))
  63. (sha256 (base32
  64. "0kg8w6qyiizlyzh4a8lpzslipcbv96hcg3rqqpnxba8ffbm8g3fv"))))
  65. (build-system gnu-build-system)
  66. (arguments
  67. ;; The use of "freetype-config" is deprecated, but other packages still
  68. ;; depend on it.
  69. `(#:configure-flags (list "--enable-freetype-config")))
  70. (native-inputs
  71. `(("pkg-config" ,pkg-config)))
  72. (propagated-inputs
  73. ;; These are all in the Requires.private field of freetype2.pc.
  74. ;; XXX: add harfbuzz.
  75. `(("libpng" ,libpng)
  76. ("zlib" ,zlib)))
  77. (synopsis "Font rendering library")
  78. (description
  79. "Freetype is a library that can be used by applications to access the
  80. contents of font files. It provides a uniform interface to access font files.
  81. It supports both bitmap and scalable formats, including TrueType, OpenType,
  82. Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
  83. anti-aliased glyph bitmap generation with 256 gray levels.")
  84. (license license:freetype) ; some files have other licenses
  85. (home-page "https://www.freetype.org/")))
  86. (define-public ttfautohint
  87. (package
  88. (name "ttfautohint")
  89. (version "1.5")
  90. (source
  91. (origin
  92. (method url-fetch)
  93. (uri (string-append "mirror://savannah/freetype/ttfautohint-"
  94. version ".tar.gz"))
  95. (sha256
  96. (base32
  97. "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4"))
  98. (patches (list (search-patch "ttfautohint-source-date-epoch.patch")))))
  99. (build-system gnu-build-system)
  100. (native-inputs
  101. `(("flex" ,flex)
  102. ("bison" ,bison)
  103. ("pkg-config" ,pkg-config)))
  104. (inputs
  105. `(("freetype" ,freetype)
  106. ("harfbuzz" ,harfbuzz)))
  107. (arguments
  108. `(#:configure-flags '("--with-qt=no"))) ;no gui
  109. (synopsis "Automated font hinting")
  110. (description
  111. "ttfautohint provides a 99% automated hinting process and a platform for
  112. finely hand-hinting the last 1%. It is ideal for web fonts and supports many
  113. scripts.")
  114. (license (list license:gpl2+ license:freetype)) ;choose one or the other
  115. (home-page "http://www.freetype.org/ttfautohint/")))
  116. (define-public woff-tools
  117. (package
  118. (name "woff-tools")
  119. (version "2009.10.04")
  120. (source
  121. (origin
  122. (method url-fetch)
  123. ;; Upstream source is unversioned, so use Debian's versioned tarball
  124. (uri (string-append "mirror://debian/pool/main/w/woff-tools/"
  125. "woff-tools_" version ".orig.tar.gz"))
  126. (file-name (string-append name "-" version ".tar.gz"))
  127. (sha256
  128. (base32
  129. "1i97gkqa6jfzlslsngqf556kx60knlgf7yc9pzsq2pizc6f0d4zl"))))
  130. (build-system gnu-build-system)
  131. (inputs
  132. `(("zlib" ,zlib)))
  133. (arguments
  134. `(#:make-flags '("CC=gcc")
  135. #:tests? #f ;no tests
  136. #:phases
  137. (modify-phases %standard-phases
  138. (delete 'configure) ;no configuration
  139. (replace 'install
  140. (lambda* (#:key outputs #:allow-other-keys)
  141. (let* ((out (assoc-ref outputs "out"))
  142. (bin (string-append out "/bin")))
  143. (install-file "sfnt2woff" bin)
  144. (install-file "woff2sfnt" bin)))))))
  145. (synopsis "Convert between OpenType and WOFF fonts")
  146. (description
  147. "This package provides two tools:
  148. @table @code
  149. @item sfnt2woff
  150. Converts OpenType fonts to WOFF fonts
  151. @item woff2sfnt
  152. Converts WOFF fonts to OpenType fonts
  153. @end table")
  154. (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))
  155. (home-page "https://people.mozilla.com/~jkew/woff/")))
  156. (define-public ttf2eot
  157. (package
  158. (name "ttf2eot")
  159. (version "0.0.3")
  160. (source
  161. (origin
  162. (method git-fetch)
  163. (uri (git-reference
  164. (url "https://github.com/wget/ttf2eot.git")
  165. (commit (string-append "v" version))))
  166. (file-name (git-file-name name version))
  167. (sha256
  168. (base32
  169. "0l2yh2ialx7135pjzhjs204kk3br7zxjr09zwaia493by2adzigr"))
  170. (patches (list (search-patch "ttf2eot-cstddef.patch")))))
  171. (build-system gnu-build-system)
  172. (arguments
  173. `(#:tests? #f ; no tests
  174. #:phases
  175. (modify-phases %standard-phases
  176. (delete 'configure) ; no configuration
  177. (replace 'install ; no install target
  178. (lambda* (#:key outputs #:allow-other-keys)
  179. (let* ((out (assoc-ref outputs "out"))
  180. (bin (string-append out "/bin")))
  181. (install-file "ttf2eot" bin)
  182. #t))))))
  183. (synopsis "Convert from TrueType to Embeddable Open Type")
  184. (description
  185. "This package contains a commandline wrapper around OpenTypeUtilities.cpp
  186. from Chromium, used to make EOT (Embeddable Open Type) files from
  187. TTF (TrueType/OpenType Font) files.")
  188. ;; While the README states "License: Derived from WebKit, so BSD/LGPL
  189. ;; 2/LGPL 2.1", the single derived source file includes only BSD in its
  190. ;; license header, and the wrapper source contains no license header.
  191. (license license:bsd-2)
  192. (home-page "https://github.com/wget/ttf2eot")))
  193. (define-public ttf2pt1
  194. (package
  195. (name "ttf2pt1")
  196. (version "3.4.4")
  197. (source (origin
  198. (method url-fetch)
  199. (uri (string-append "mirror://sourceforge/ttf2pt1/ttf2pt1/"
  200. version "/ttf2pt1-" version ".tgz"))
  201. (sha256
  202. (base32
  203. "1l718n4k4widx49xz7qrj4mybzb8q67kp2jw7f47604ips4654mf"))
  204. (modules '((guix build utils)))
  205. (snippet
  206. '(begin
  207. ;; Remove trailing backslashes in the sed expression of the
  208. ;; 'install' rule since sed would otherwise fail.
  209. (substitute* "Makefile"
  210. (("\\|;\\\\[[:space:]]*$") "|; "))
  211. #t))))
  212. (build-system gnu-build-system)
  213. (arguments
  214. '(#:tests? #f ;no tests
  215. #:phases (modify-phases %standard-phases
  216. (replace 'configure
  217. (lambda* (#:key outputs #:allow-other-keys)
  218. (let ((out (assoc-ref outputs "out")))
  219. (substitute* "Makefile"
  220. (("INSTDIR =.*")
  221. (string-append "INSTDIR = " out "\n"))
  222. (("OWNER = .*")
  223. "OWNER = `id -un`\n")
  224. (("GROUP = .*")
  225. "GROUP = `id -g`\n"))
  226. #t)))
  227. (replace 'build
  228. (lambda _
  229. (invoke "make" "-j"
  230. (number->string (parallel-job-count))
  231. "all" "CC=gcc"))))))
  232. (inputs `(("perl" ,perl)))
  233. (synopsis "Convert TrueType fonts to Postscript Type 1")
  234. (description
  235. "TTF2PT1 provides tools to convert most TrueType fonts (or other formats
  236. supported by the FreeType library) to an Adobe Type 1 @file{.pfa} or
  237. @file{.pfb} file. Another use is as a hinting engine: feed it an unhinted or
  238. poorly hinted Adobe Type 1 font through the FreeType library and get it back
  239. with freshly generated hints. The files produced by default are in
  240. human-readable form, which further needs to be encoded with t1utilities to
  241. work with most software requiring Type 1 fonts.")
  242. (home-page "http://ttf2pt1.sourceforge.net/")
  243. (license license:bsd-3)))
  244. (define-public woff2
  245. (let ((commit "4e698b8c6c5e070d53c340db9ddf160e21070ede")
  246. (revision "1"))
  247. (package
  248. (name "woff2")
  249. (version (string-append "20160306-" revision "."
  250. (string-take commit 7)))
  251. (source (origin
  252. (method git-fetch)
  253. (uri (git-reference
  254. (url "https://github.com/google/woff2.git")
  255. (commit commit)))
  256. (file-name (string-append name "-" version ".tar.xz"))
  257. (sha256
  258. (base32
  259. "0wka0yhf0cjmd4rv2jckxpyv6lb5ckj4nj0k1ajq5hrjy7f30lcp"))
  260. (patches (list (search-patch "woff2-libbrotli.patch")))))
  261. (build-system gnu-build-system)
  262. (native-inputs
  263. `(("pkg-config" ,pkg-config)))
  264. (inputs
  265. `(("brotli" ,brotli)))
  266. (arguments
  267. `(#:tests? #f ;no tests
  268. #:phases (modify-phases %standard-phases
  269. (delete 'configure)
  270. (replace 'install
  271. (lambda* (#:key outputs #:allow-other-keys)
  272. (let* ((out (assoc-ref outputs "out"))
  273. (bin (string-append out "/bin")))
  274. (install-file "woff2_compress" bin)
  275. (install-file "woff2_decompress" bin)
  276. #t))))))
  277. (synopsis "Compress TrueType fonts to WOFF2")
  278. (description
  279. "This package provides utilities for compressing/decompressing TrueType
  280. fonts to/from the WOFF2 format.")
  281. (license license:asl2.0)
  282. (home-page "https://github.com/google/woff2"))))
  283. (define-public fontconfig
  284. (package
  285. (name "fontconfig")
  286. (version "2.13.1")
  287. (source (origin
  288. (method url-fetch)
  289. (uri (string-append
  290. "https://www.freedesktop.org/software/fontconfig/release/fontconfig-"
  291. version ".tar.bz2"))
  292. (sha256 (base32
  293. "0hb700a68kk0ip51wdlnjjc682kvlrmb6q920mzajykdk0mdsmgn"))))
  294. (build-system gnu-build-system)
  295. ;; In Requires or Requires.private of fontconfig.pc.
  296. (propagated-inputs `(("expat" ,expat)
  297. ("freetype" ,freetype)
  298. ("libuuid" ,util-linux)))
  299. (inputs `(("gs-fonts" ,gs-fonts)))
  300. (native-inputs
  301. `(("gperf" ,gperf)
  302. ("pkg-config" ,pkg-config)))
  303. (arguments
  304. `(#:configure-flags
  305. (list "--with-cache-dir=/var/cache/fontconfig"
  306. ;; register gs-fonts as default fonts
  307. (string-append "--with-default-fonts="
  308. (assoc-ref %build-inputs "gs-fonts")
  309. "/share/fonts")
  310. ;; Register fonts from user and system profiles.
  311. (string-append "--with-add-fonts="
  312. "~/.guix-profile/share/fonts,"
  313. "/run/current-system/profile/share/fonts")
  314. ;; python is not actually needed
  315. "PYTHON=false")
  316. #:phases
  317. (modify-phases %standard-phases
  318. (replace 'install
  319. (lambda _
  320. ;; Don't try to create /var/cache/fontconfig.
  321. (invoke "make" "install"
  322. "fc_cachedir=$(TMPDIR)"
  323. "RUN_FC_CACHE_TEST=false"))))))
  324. (synopsis "Library for configuring and customizing font access")
  325. (description
  326. "Fontconfig can discover new fonts when installed automatically;
  327. perform font name substitution, so that appropriate alternative fonts can
  328. be selected if fonts are missing;
  329. identify the set of fonts required to completely cover a set of languages;
  330. have GUI configuration tools built as it uses an XML-based configuration file;
  331. efficiently and quickly find needed fonts among the set of installed fonts;
  332. be used in concert with the X Render Extension and FreeType to implement
  333. high quality, anti-aliased and subpixel rendered text on a display.")
  334. ; The exact license is more X11-style than BSD-style.
  335. (license (license:non-copyleft "file://COPYING"
  336. "See COPYING in the distribution."))
  337. (home-page "https://www.freedesktop.org/wiki/Software/fontconfig")))
  338. (define-public t1lib
  339. (package
  340. (name "t1lib")
  341. (version "5.1.2")
  342. (source (origin
  343. (method url-fetch)
  344. (uri (list (string-append "ftp://sunsite.unc.edu/pub/Linux/libs/"
  345. "graphics/" name "-" version ".tar.gz")
  346. (string-append "https://fossies.org/linux/misc/old/"
  347. name "-" version ".tar.gz")))
  348. (sha256 (base32
  349. "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))
  350. (patches (search-patches
  351. "t1lib-CVE-2010-2642.patch" ; 2011-0443, 2011-5244
  352. "t1lib-CVE-2011-0764.patch"
  353. "t1lib-CVE-2011-1552+.patch")))) ; 2011-1553, 2011-1554
  354. (properties `((lint-hidden-cve . ("CVE-2011-0433"
  355. "CVE-2011-1553"
  356. "CVE-2011-1554"
  357. "CVE-2011-5244"))))
  358. (build-system gnu-build-system)
  359. (arguments
  360. ;; Making the documentation requires latex, but t1lib is also an input
  361. ;; for building texlive.
  362. `(#:tests? #f ; no test target
  363. #:make-flags
  364. '("without_doc")))
  365. (synopsis "Library for generating bitmaps from Type 1 fonts")
  366. (description
  367. "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
  368. It is based on the code of the X11 rasteriser of the X11 project.
  369. The bitmaps created by t1lib are returned in a data structure with type
  370. GLYPH. This special GLYPH-type is also used in the X11 window system to
  371. describe character bitmaps. It contains the bitmap data as well as some
  372. metric information. But t1lib is in itself entirely independent of the
  373. X11-system or any other graphical user interface.")
  374. (license license:gpl2)
  375. (home-page "http://www.t1lib.org/")))
  376. (define-public teckit
  377. (package
  378. (name "teckit")
  379. (version "2.5.8")
  380. (source
  381. (origin
  382. (method git-fetch)
  383. (uri (git-reference
  384. (url "https://github.com/silnrsi/teckit")
  385. (commit (string-append "v" version))))
  386. (file-name (git-file-name name version))
  387. (sha256
  388. (base32 "1jmsdmfz7bgq1n5qsqgpq1b1n77f1hll0czfw5wkxz4knzb14ndn"))))
  389. (build-system gnu-build-system)
  390. (inputs
  391. `(("zlib" ,zlib)
  392. ("expat" ,expat)))
  393. (native-inputs
  394. `(("autoconf" ,autoconf)
  395. ("automake" ,automake)
  396. ("libtool" ,libtool)
  397. ("perl" ,perl))) ; for the tests
  398. (synopsis "Toolkit for encoding conversions")
  399. (description
  400. "TECkit is a low-level toolkit intended to be used by other applications
  401. that need to perform encoding conversions (e.g., when importing legacy data
  402. into a Unicode-based application). The primary component of the TECkit
  403. package is therefore a library that performs conversions; this is the
  404. \"TECkit engine\". The engine relies on mapping tables in a specific binary
  405. format (for which documentation is available); there is a compiler that
  406. creates such tables from a human-readable mapping description (a simple
  407. text file).
  408. To facilitate the development and testing of mapping tables for TECkit,
  409. several applications are also included in the current package; these
  410. include simple tools for applying conversions to plain-text and Standard
  411. Format files, as well as both command-line and simple GUI versions of the
  412. TECkit compiler. However, it is not intended that these tools will be the
  413. primary means by which end users perform conversions, and they have not
  414. been designed, tested, and debugged to the extent that general-purpose
  415. applications should be.")
  416. (license license:lgpl2.1+)
  417. (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
  418. (define-public graphite2
  419. (package
  420. (name "graphite2")
  421. (version "1.3.12")
  422. (source
  423. (origin
  424. (method url-fetch)
  425. (uri (string-append "https://github.com/silnrsi/graphite/releases/"
  426. "download/" version "/" name "-" version ".tgz"))
  427. (sha256
  428. (base32
  429. "1l1940d8fz67jm6a0x8cjb5p2dv48cvz3wcskwa83hamd70k15fd"))))
  430. (build-system cmake-build-system)
  431. (native-inputs
  432. `(("python" ,python-2) ; because of "import imap" in tests
  433. ("python-fonttools" ,python2-fonttools)))
  434. (inputs
  435. `(("freetype" ,freetype)))
  436. (synopsis "Reimplementation of the SIL Graphite text processing engine")
  437. (description
  438. "Graphite2 is a reimplementation of the SIL Graphite text processing
  439. engine. Graphite is a smart font technology designed to facilitate the
  440. process known as shaping. This process takes an input Unicode text string
  441. and returns a sequence of positioned glyphids from the font.")
  442. (license license:lgpl2.1+)
  443. (home-page "https://github.com/silnrsi/graphite")))
  444. (define-public potrace
  445. (package
  446. (name "potrace")
  447. (version "1.15")
  448. (source
  449. (origin
  450. (method url-fetch)
  451. (uri (string-append "mirror://sourceforge/potrace/" version
  452. "/potrace-" version ".tar.gz"))
  453. (sha256
  454. (base32
  455. "17ajildjp14shsy339xarh1lw1p0k60la08ahl638a73mh23kcx9"))
  456. (patches (search-patches "potrace-tests.patch"))))
  457. (build-system gnu-build-system)
  458. (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
  459. (inputs `(("zlib" ,zlib)))
  460. (arguments
  461. `(#:configure-flags
  462. `("--with-libpotrace"))) ; install library and headers
  463. (synopsis "Transform bitmaps into vector graphics")
  464. (description
  465. "Potrace is a tool for tracing a bitmap, which means, transforming a
  466. bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
  467. or BMP format), and the default output is an encapsulated PostScript
  468. file (EPS). A typical use is to create EPS files from scanned data, such as
  469. company or university logos, handwritten notes, etc. The resulting image is
  470. not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
  471. resolution.")
  472. (license license:gpl2+)
  473. (home-page "http://potrace.sourceforge.net/")))
  474. (define-public libotf
  475. (package
  476. (name "libotf")
  477. (version "0.9.16")
  478. (source (origin
  479. (method url-fetch)
  480. (uri (string-append "mirror://savannah/m17n/libotf-"
  481. version ".tar.gz"))
  482. (sha256
  483. (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
  484. (build-system gnu-build-system)
  485. (native-inputs
  486. `(("pkg-config" ,pkg-config)))
  487. (propagated-inputs
  488. `(("freetype" ,freetype)))
  489. (home-page "https://www.nongnu.org/m17n/")
  490. (synopsis "Library for handling OpenType Font")
  491. (description "This library can read Open Type Layout Tables from an OTF
  492. file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and
  493. GPOS. It can convert a Unicode character sequence to a glyph code sequence by
  494. using the above tables.")
  495. (license license:lgpl2.0+)))
  496. (define-public libspiro
  497. (package
  498. (name "libspiro")
  499. (version "0.5.20150702")
  500. (source
  501. (origin
  502. (method url-fetch)
  503. (uri (string-append "https://github.com/fontforge/libspiro/releases"
  504. "/download/" version "/libspiro-dist-" version ".tar.gz"))
  505. (sha256
  506. (base32
  507. "153ckwj6h3wwlsgcppzqj8cymv1927hi8ar8fzpchq5q89cj2kai"))))
  508. (build-system gnu-build-system)
  509. (synopsis "Clothoid to bezier conversion library")
  510. (description
  511. "Raph Levien's Spiro package as a library. A mechanism for drawing
  512. smooth contours with constant curvature at the spline joins.")
  513. (license license:gpl2+)
  514. (home-page "http://libspiro.sourceforge.net/")))
  515. (define-public libuninameslist
  516. (package
  517. (name "libuninameslist")
  518. (version "20180701")
  519. (home-page "https://github.com/fontforge/libuninameslist")
  520. (source
  521. (origin
  522. (method url-fetch)
  523. (uri (string-append home-page "/releases/download/" version
  524. "/libuninameslist-dist-" version ".tar.gz"))
  525. (sha256
  526. (base32
  527. "141wh2f5jsaw84mgw6vf2c9hd2wm957a2hpnicyqjbc7pk89gvca"))))
  528. (build-system gnu-build-system)
  529. (synopsis "Unicode names and annotation list")
  530. (description
  531. "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
  532. useful for programs that need Unicode \"Names\", \"Annotations\", and block
  533. definitions.")
  534. ;; COPYING specifies GPL2, but according to LICENSE it only covers the
  535. ;; configure script. The actual code is BSD-3, and the Unicode data
  536. ;; is governed by an X11-style license only found on the web.
  537. (license (list license:bsd-3
  538. (license:x11-style
  539. "https://www.unicode.org/copyright.html#License")))))
  540. (define-public fontforge
  541. (package
  542. (name "fontforge")
  543. (version "20170731")
  544. (source (origin
  545. (method url-fetch)
  546. (uri (string-append
  547. "https://github.com/fontforge/fontforge/releases/download/"
  548. version "/fontforge-dist-" version ".tar.xz"))
  549. (sha256 (base32
  550. "08l8h3yvk4v7652jvmd3ls7nf5miybkx2fmkf1mpwwfixpxxw2l4"))))
  551. (build-system gnu-build-system)
  552. (native-inputs
  553. `(("pkg-config" ,pkg-config)))
  554. (inputs `(("cairo" ,cairo)
  555. ("fontconfig" ,fontconfig) ;dlopen'd
  556. ("freetype" ,freetype)
  557. ("gettext" ,gettext-minimal)
  558. ("glib" ,glib) ;needed for pango detection
  559. ("libICE" ,libice)
  560. ("libSM" ,libsm)
  561. ("libX11" ,libx11)
  562. ("libXi" ,libxi)
  563. ("libjpeg" ,libjpeg)
  564. ("libltdl" ,libltdl)
  565. ("libpng" ,libpng)
  566. ("libspiro" ,libspiro)
  567. ("libtiff" ,libtiff)
  568. ("libungif" ,libungif)
  569. ("libuninameslist" ,libuninameslist)
  570. ("libxft" ,libxft)
  571. ("libxml2" ,libxml2)
  572. ("pango" ,pango)
  573. ("potrace" ,potrace)
  574. ;; FIXME: We use Python 2 here because there is a bug in Python
  575. ;; 3.7 that is triggered when Py_Main is called after Py_Init, as
  576. ;; is done by fontforge. This will be fixed in Python 3.7.1.
  577. ("python" ,python-2)
  578. ("zlib" ,zlib)))
  579. (arguments
  580. '(#:phases
  581. (modify-phases %standard-phases
  582. (add-after 'install 'set-library-path
  583. (lambda* (#:key inputs outputs #:allow-other-keys)
  584. (let ((out (assoc-ref outputs "out"))
  585. (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
  586. (wrap-program (string-append out "/bin/fontforge")
  587. ;; Fontforge dynamically opens libraries.
  588. `("LD_LIBRARY_PATH" ":" prefix
  589. ,(map (lambda (input)
  590. (string-append (assoc-ref inputs input)
  591. "/lib"))
  592. '("libtiff" "libjpeg" "libpng" "libungif"
  593. "libxml2" "zlib" "libspiro" "freetype"
  594. "pango" "cairo" "fontconfig")))
  595. ;; Checks for potrace program at runtime
  596. `("PATH" ":" prefix (,potrace)))
  597. #t))))
  598. ;; Skip test 40 "FontForge .sfd file open check" to work around
  599. ;; <https://github.com/fontforge/fontforge/issues/3246>.
  600. #:make-flags '("TESTSUITEFLAGS=-k '!\\.sfd'")))
  601. (synopsis "Outline font editor")
  602. (description
  603. "FontForge allows you to create and modify postscript, truetype and
  604. opentype fonts. You can save fonts in many different outline formats, and
  605. generate bitmaps.")
  606. (license license:gpl3+)
  607. (home-page "https://fontforge.github.io/en-US/")))
  608. (define-public python2-ufolib
  609. (package
  610. (name "python2-ufolib")
  611. (version "2.1.1")
  612. (source
  613. (origin
  614. (method url-fetch)
  615. (uri (pypi-uri "ufoLib" version ".zip"))
  616. (sha256
  617. (base32 "07qy6mx7z0wi9a30lc2hj5i9q1gnz1n8l40dmjz2c19mj9s6mz9l"))))
  618. (build-system python-build-system)
  619. (arguments
  620. `(#:python ,python-2))
  621. (propagated-inputs
  622. `(("python2-fonttools" ,python2-fonttools)))
  623. (native-inputs
  624. `(("unzip" ,unzip)
  625. ("python2-pytest" ,python2-pytest)
  626. ("python2-pytest-runner" ,python2-pytest-runner)))
  627. (home-page "https://github.com/unified-font-object/ufoLib")
  628. (synopsis "Low-level UFO reader and writer")
  629. (description
  630. "UfoLib reads and writes Unified Font Object (UFO)
  631. files. UFO is a file format that stores fonts source files.")
  632. (license license:bsd-3)))
  633. (define-public python2-defcon
  634. (package
  635. (name "python2-defcon")
  636. (version "0.3.5")
  637. (source
  638. (origin
  639. (method url-fetch)
  640. (uri (pypi-uri "defcon" version ".zip"))
  641. (sha256
  642. (base32
  643. "03jlm2gy9lvbwj68kfdm43yaddwd634jwkdg4wf0jxx2s8mwbg22"))))
  644. (build-system python-build-system)
  645. (arguments
  646. `(#:python ,python-2))
  647. (native-inputs
  648. `(("unzip" ,unzip)
  649. ("python2-pytest" ,python2-pytest)
  650. ("python2-pytest-runner" ,python2-pytest-runner)))
  651. (propagated-inputs
  652. `(("python2-fonttools" ,python2-fonttools)
  653. ("python2-ufolib" ,python2-ufolib)))
  654. (home-page "https://pypi.python.org/pypi/defcon")
  655. (synopsis "Flexible objects for representing @acronym{UFO, unified font object} data")
  656. (description
  657. "Defcon is a set of @acronym{UFO, unified font object} based objects
  658. optimized for use in font editing applications. The objects are built to
  659. be lightweight, fast and flexible. The objects are very bare-bones and
  660. they are not meant to be end-all, be-all objects. Rather, they are meant
  661. to provide base functionality so that you can focus on your application’s
  662. behavior, not object observing or maintaining cached data. Defcon
  663. implements UFO3 as described by the UFO font format.")
  664. (license license:expat)))
  665. (define-public nototools
  666. (package
  667. (name "nototools")
  668. (version "20170925")
  669. (source
  670. (origin
  671. (method url-fetch)
  672. (uri (string-append "https://github.com/googlei18n/nototools/"
  673. "archive/v2017-09-25-tooling-for-phase3-"
  674. "update.tar.gz"))
  675. (file-name (string-append name "-" version ".tar.gz"))
  676. (sha256
  677. (base32
  678. "1pvacw18cm9l4sb66pqyjc7hc74xhhfxc7kd5ald8lixf4wzg0s8"))))
  679. (build-system python-build-system)
  680. (arguments
  681. `(#:python ,python-2))
  682. (propagated-inputs
  683. `(("python2-booleanoperations" ,python2-booleanoperations)
  684. ("python2-defcon" ,python2-defcon)
  685. ("python2-fonttools" ,python2-fonttools)
  686. ("python2-pillow" ,python2-pillow)
  687. ("python2-pyclipper" ,python2-pyclipper)
  688. ("python2-ufolib" ,python2-ufolib)))
  689. (home-page "https://github.com/googlei18n/nototools")
  690. (synopsis "Noto fonts support tools and scripts")
  691. (description
  692. "Nototools is a Python package containing Python scripts used to
  693. maintain the Noto Fonts project.")
  694. (license (list license:asl2.0
  695. ;; Sample texts are attributed to UN and OHCHR.
  696. ;; The permissions on the UDHR are pretty lax:
  697. ;; http://www.ohchr.org/EN/UDHR/Pages/Introduction.aspx
  698. ;; "If UDHR translations or materials are reproduced, users
  699. ;; should make reference to this website as a source by
  700. ;; providing a link."
  701. license:public-domain
  702. (license:non-copyleft
  703. "file://sample_texts/attributions.txt"
  704. "See sample_texts/attributions.txt in the distribution.")))))