Commit | Line | Data |
---|---|---|
b387a1c5 | 1 | ;;; GNU Guix --- Functional package management for GNU |
f1597358 | 2 | ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr> |
ee69f85c | 3 | ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> |
e86409c5 | 4 | ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org> |
5c85c726 | 5 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
b387a1c5 AE |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
a86177d6 | 22 | (define-module (gnu packages fontutils) |
b387a1c5 | 23 | #:use-module (gnu packages) |
e5c0701f | 24 | #:use-module (gnu packages compression) |
b972db72 | 25 | #:use-module (gnu packages ghostscript) |
319e2d17 | 26 | #:use-module (gnu packages perl) |
6e4da6ea | 27 | #:use-module (gnu packages pkg-config) |
f945bf06 | 28 | #:use-module (gnu packages autotools) |
0c115d8c | 29 | #:use-module (gnu packages gettext) |
319e2d17 | 30 | #:use-module (gnu packages python) |
0c115d8c EB |
31 | #:use-module (gnu packages image) |
32 | #:use-module (gnu packages glib) | |
33 | #:use-module (gnu packages xorg) | |
34 | #:use-module (gnu packages gtk) | |
6e4da6ea | 35 | #:use-module (gnu packages xml) |
b5b73a82 | 36 | #:use-module ((guix licenses) #:prefix license:) |
b387a1c5 AE |
37 | #:use-module (guix packages) |
38 | #:use-module (guix download) | |
1436c5c7 | 39 | #:use-module (guix svn-download) |
319e2d17 | 40 | #:use-module (guix build-system cmake) |
b387a1c5 AE |
41 | #:use-module (guix build-system gnu)) |
42 | ||
43 | (define-public freetype | |
44 | (package | |
45 | (name "freetype") | |
c6f90980 | 46 | (version "2.6") |
b387a1c5 AE |
47 | (source (origin |
48 | (method url-fetch) | |
36ee486f | 49 | (uri (string-append "mirror://savannah/freetype/freetype-" |
9e91418b | 50 | version ".tar.bz2")) |
b387a1c5 | 51 | (sha256 (base32 |
c6f90980 | 52 | "0zilx15fwcpa8hmcxpc423jwb8ijw4qpq968kh18akvn4j0znsc4")))) |
b387a1c5 | 53 | (build-system gnu-build-system) |
0a92b5b3 AE |
54 | (arguments |
55 | `(#:phases | |
9e91418b AE |
56 | ;; This should not be necessary; reported upstream as |
57 | ;; https://savannah.nongnu.org/bugs/index.php?44261 | |
58 | (alist-cons-before | |
59 | 'configure 'set-paths | |
60 | (lambda _ | |
61 | (setenv "CONFIG_SHELL" (which "bash"))) | |
62 | %standard-phases))) | |
35b9e423 | 63 | (synopsis "Font rendering library") |
b387a1c5 AE |
64 | (description |
65 | "Freetype is a library that can be used by applications to access the | |
35b9e423 | 66 | contents of font files. It provides a uniform interface to access font files. |
b387a1c5 | 67 | It supports both bitmap and scalable formats, including TrueType, OpenType, |
35b9e423 | 68 | Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed |
b387a1c5 | 69 | anti-aliased glyph bitmap generation with 256 gray levels.") |
79c398a2 | 70 | (license license:freetype) ; some files have other licenses |
b387a1c5 | 71 | (home-page "http://www.freetype.org/"))) |
6e4da6ea AE |
72 | |
73 | (define-public fontconfig | |
74 | (package | |
75 | (name "fontconfig") | |
030fa12e | 76 | (version "2.11.94") |
6e4da6ea AE |
77 | (source (origin |
78 | (method url-fetch) | |
79 | (uri (string-append | |
5cc3096c | 80 | "https://www.freedesktop.org/software/fontconfig/release/fontconfig-" |
6e4da6ea AE |
81 | version ".tar.bz2")) |
82 | (sha256 (base32 | |
030fa12e | 83 | "1psrl4b4gi4wmbvwwh43lk491wsl8lgvqj146prlcha3vwjc0qyp")))) |
6e4da6ea | 84 | (build-system gnu-build-system) |
80650d77 MW |
85 | (propagated-inputs `(("expat" ,expat) |
86 | ("freetype" ,freetype))) | |
87 | (inputs `(("gs-fonts" ,gs-fonts))) | |
c4c4cc05 JD |
88 | (native-inputs |
89 | `(("pkg-config" ,pkg-config))) | |
0ceea4f3 | 90 | (arguments |
030fa12e SB |
91 | `(#:configure-flags |
92 | (list "--with-cache-dir=/var/cache/fontconfig" | |
93 | ;; register gs-fonts as default fonts | |
94 | (string-append "--with-default-fonts=" | |
95 | (assoc-ref %build-inputs "gs-fonts") | |
96 | "/share/fonts") | |
97 | ;; register fonts from user profile | |
98 | "--with-add-fonts=~/.guix-profile/share/fonts" | |
99 | ;; python is not actually needed | |
100 | "PYTHON=false") | |
101 | #:phases | |
102 | (modify-phases %standard-phases | |
103 | (replace 'install | |
104 | (lambda _ | |
105 | ;; Don't try to create /var/cache/fontconfig. | |
106 | (zero? (system* "make" "install" | |
107 | "fc_cachedir=$(TMPDIR)" | |
108 | "RUN_FC_CACHE_TEST=false"))))))) | |
9e771e3b | 109 | (synopsis "Library for configuring and customizing font access") |
6e4da6ea AE |
110 | (description |
111 | "Fontconfig can discover new fonts when installed automatically; | |
112 | perform font name substitution, so that appropriate alternative fonts can | |
113 | be selected if fonts are missing; | |
114 | identify the set of fonts required to completely cover a set of languages; | |
115 | have GUI configuration tools built as it uses an XML-based configuration file; | |
116 | efficiently and quickly find needed fonts among the set of installed fonts; | |
117 | be used in concert with the X Render Extension and FreeType to implement | |
118 | high quality, anti-aliased and subpixel rendered text on a display.") | |
119 | ; The exact license is more X11-style than BSD-style. | |
166191b3 | 120 | (license (license:non-copyleft "file://COPYING" |
6e4da6ea AE |
121 | "See COPYING in the distribution.")) |
122 | (home-page "http://www.freedesktop.org/wiki/Software/fontconfig"))) | |
313b9012 AE |
123 | |
124 | (define-public t1lib | |
125 | (package | |
126 | (name "t1lib") | |
127 | (version "5.1.2") | |
128 | (source (origin | |
129 | (method url-fetch) | |
130 | (uri "ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz") | |
131 | (sha256 (base32 | |
132 | "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2")))) | |
133 | (build-system gnu-build-system) | |
134 | (arguments | |
135 | ;; Making the documentation requires latex, but t1lib is also an input | |
136 | ;; for building texlive. | |
137 | `(#:tests? #f ; no test target | |
138 | #:make-flags | |
139 | '("without_doc"))) | |
9e771e3b | 140 | (synopsis "Library for generating bitmaps from Type 1 fonts") |
313b9012 AE |
141 | (description |
142 | "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts. | |
143 | It is based on the code of the X11 rasteriser of the X11 project. | |
144 | ||
145 | The bitmaps created by t1lib are returned in a data structure with type | |
35b9e423 EB |
146 | GLYPH. This special GLYPH-type is also used in the X11 window system to |
147 | describe character bitmaps. It contains the bitmap data as well as some | |
148 | metric information. But t1lib is in itself entirely independent of the | |
149 | X11-system or any other graphical user interface.") | |
313b9012 AE |
150 | (license license:gpl2) |
151 | (home-page "http://www.t1lib.org/"))) | |
e5c0701f AE |
152 | |
153 | (define-public teckit | |
154 | (package | |
155 | (name "teckit") | |
1436c5c7 | 156 | (version "2.5.4") |
e5c0701f | 157 | (source (origin |
1436c5c7 AE |
158 | ;; Downloaded tarballs vary with each download, so we use an |
159 | ;; svn snapshot. The 2.5.4 release seems to be made in r128, | |
160 | ;; but r132 updates additional files to contain the correct | |
161 | ;; version number (r129 to r131 do not concern TRUNK). | |
162 | (method svn-fetch) | |
163 | (uri (svn-reference | |
164 | (url "https://scripts.sil.org/svn-public/teckit/TRUNK") | |
165 | (revision 132))) | |
166 | (file-name (string-append name "-" version)) | |
167 | (sha256 | |
168 | (base32 | |
169 | "1xqkqgw30pb24snh46srmjs2j4zhz2dfi5pf7znia0k34mrpwivz")))) | |
e5c0701f | 170 | (build-system gnu-build-system) |
01eafd38 | 171 | (inputs `(("zlib" ,zlib))) |
1436c5c7 AE |
172 | (native-inputs |
173 | `(("autoconf" ,autoconf) | |
174 | ("automake" ,automake) | |
175 | ("libtool" ,libtool) | |
176 | ("perl" ,perl))) ; for the tests | |
177 | (arguments | |
178 | `(#:phases | |
179 | (modify-phases %standard-phases | |
180 | (add-after 'unpack 'autogen | |
181 | (lambda _ | |
182 | (zero? (system* "sh" "autogen.sh"))))))) | |
35b9e423 | 183 | (synopsis "Toolkit for encoding conversions") |
e5c0701f AE |
184 | (description |
185 | "TECkit is a low-level toolkit intended to be used by other applications | |
186 | that need to perform encoding conversions (e.g., when importing legacy data | |
35b9e423 | 187 | into a Unicode-based application). The primary component of the TECkit |
e5c0701f | 188 | package is therefore a library that performs conversions; this is the |
35b9e423 | 189 | \"TECkit engine\". The engine relies on mapping tables in a specific binary |
e5c0701f AE |
190 | format (for which documentation is available); there is a compiler that |
191 | creates such tables from a human-readable mapping description (a simple | |
192 | text file). | |
193 | ||
194 | To facilitate the development and testing of mapping tables for TECkit, | |
195 | several applications are also included in the current package; these | |
196 | include simple tools for applying conversions to plain-text and Standard | |
197 | Format files, as well as both command-line and simple GUI versions of the | |
35b9e423 | 198 | TECkit compiler. However, it is not intended that these tools will be the |
e5c0701f AE |
199 | primary means by which end users perform conversions, and they have not |
200 | been designed, tested, and debugged to the extent that general-purpose | |
201 | applications should be.") | |
202 | (license license:lgpl2.1+) | |
203 | (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit"))) | |
319e2d17 AE |
204 | |
205 | (define-public graphite2 | |
206 | (package | |
d47ad089 | 207 | (replacement graphite2-1.3.6) |
319e2d17 | 208 | (name "graphite2") |
e86409c5 | 209 | (version "1.3.5") |
319e2d17 AE |
210 | (source |
211 | (origin | |
212 | (method url-fetch) | |
e86409c5 MW |
213 | (uri (string-append "https://github.com/silnrsi/graphite/archive/" |
214 | version ".tar.gz")) | |
215 | (file-name (string-append name "-" version ".tar.gz")) | |
319e2d17 AE |
216 | (sha256 |
217 | (base32 | |
e86409c5 | 218 | "0jrjb56zim57xg2pckfdyrw46c624mqz9zywgwza0g1bxg26940w")))) |
319e2d17 | 219 | (build-system cmake-build-system) |
e6f22a82 SB |
220 | (native-inputs |
221 | `(("python" ,python-2) ; because of "import imap" in tests | |
222 | ("python-fonttools" ,python2-fonttools))) | |
319e2d17 | 223 | (inputs |
e6f22a82 | 224 | `(("freetype" ,freetype))) |
35b9e423 | 225 | (synopsis "Reimplementation of the SIL Graphite text processing engine") |
319e2d17 AE |
226 | (description |
227 | "Graphite2 is a reimplementation of the SIL Graphite text processing | |
228 | engine. Graphite is a smart font technology designed to facilitate the | |
229 | process known as shaping. This process takes an input Unicode text string | |
230 | and returns a sequence of positioned glyphids from the font.") | |
231 | (license license:lgpl2.1+) | |
e86409c5 | 232 | (home-page "https://github.com/silnrsi/graphite"))) |
ee69f85c | 233 | |
d47ad089 MW |
234 | (define graphite2-1.3.6 |
235 | (package | |
236 | (inherit graphite2) | |
237 | (replacement #f) | |
238 | (source | |
239 | (let ((name "graphite2") (version "1.3.6")) | |
240 | (origin | |
241 | (method url-fetch) | |
242 | (uri (string-append "https://github.com/silnrsi/graphite/archive/" | |
243 | version ".tar.gz")) | |
244 | (file-name (string-append name "-" version ".tar.gz")) | |
245 | (sha256 | |
246 | (base32 | |
247 | "1frd9mjaqzvh9gs74ngc43igi53vzjzlwr5chbrs6ii1hc4aa23s"))))))) | |
248 | ||
ee69f85c EB |
249 | (define-public potrace |
250 | (package | |
251 | (name "potrace") | |
252 | (version "1.11") | |
253 | (source | |
254 | (origin | |
255 | (method url-fetch) | |
256 | (uri (string-append "mirror://sourceforge/potrace/potrace-" | |
257 | version ".tar.gz")) | |
258 | (sha256 | |
259 | (base32 | |
260 | "1bbyl7jgigawmwc8r14znv8lb6lrcxh8zpvynrl6s800dr4yp9as")))) | |
261 | (build-system gnu-build-system) | |
262 | (native-inputs `(("ghostscript" ,ghostscript))) ;for tests | |
263 | (inputs `(("zlib" ,zlib))) | |
4797d84d AE |
264 | (arguments |
265 | `(#:configure-flags | |
266 | `("--with-libpotrace"))) ; install library and headers | |
ee69f85c EB |
267 | (synopsis "Transform bitmaps into vector graphics") |
268 | (description | |
269 | "Potrace is a tool for tracing a bitmap, which means, transforming a | |
270 | bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM, | |
271 | or BMP format), and the default output is an encapsulated PostScript | |
272 | file (EPS). A typical use is to create EPS files from scanned data, such as | |
273 | company or university logos, handwritten notes, etc. The resulting image is | |
274 | not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any | |
275 | resolution.") | |
276 | (license license:gpl2+) | |
277 | (home-page "http://potrace.sourceforge.net/"))) | |
5277dbb0 | 278 | |
6ef0ec76 RJ |
279 | (define-public libotf |
280 | (package | |
281 | (name "libotf") | |
282 | (version "0.9.13") | |
283 | (source (origin | |
284 | (method url-fetch) | |
285 | (uri (string-append | |
8b15f42c | 286 | "mirror://savannah/releases/m17n/libotf-" |
6ef0ec76 RJ |
287 | version ".tar.gz")) |
288 | (sha256 | |
289 | (base32 "0239zvfan56w7vrppriwy77fzb10ag9llaz15nsraps2a2x6di3v")))) | |
290 | (build-system gnu-build-system) | |
291 | (propagated-inputs | |
292 | `(("freetype" ,freetype))) | |
293 | (home-page "http://www.nongnu.org/m17n/") | |
294 | (synopsis "Library for handling OpenType Font") | |
295 | (description "This library can read Open Type Layout Tables from an OTF | |
296 | file. Currently these tables are supported; head, name, cmap, GDEF, GSUB, and | |
297 | GPOS. It can convert a Unicode character sequence to a glyph code sequence by | |
298 | using the above tables.") | |
299 | (license license:lgpl2.0+))) | |
300 | ||
5277dbb0 EB |
301 | (define-public libspiro |
302 | (package | |
303 | (name "libspiro") | |
304 | (version "20071029") | |
305 | (source | |
306 | (origin | |
307 | (method url-fetch) | |
308 | (uri (string-append "mirror://sourceforge/libspiro/libspiro/" | |
309 | version "/libspiro_src-" version ".tar.bz2")) | |
310 | (sha256 | |
311 | (base32 | |
312 | "1kylz8pvwnb85yya150r9i6mhbpzx38f32qy523qg3ylgd9b3zhy")))) | |
313 | (build-system gnu-build-system) | |
314 | (arguments `(#:tests? #f)) ;no tests | |
315 | (synopsis "Clothoid to bezier conversion library") | |
316 | (description | |
317 | "Raph Levien's Spiro package as a library. A mechanism for drawing | |
318 | smooth contours with constant curvature at the spline joins.") | |
319 | (license license:gpl2+) | |
320 | (home-page "http://libspiro.sourceforge.net/"))) | |
f945bf06 EB |
321 | |
322 | (define-public libuninameslist | |
323 | (package | |
324 | (name "libuninameslist") | |
5c85c726 | 325 | (version "0.5.20150701") |
f945bf06 EB |
326 | (source |
327 | (origin | |
328 | (method url-fetch) | |
329 | (uri (string-append "https://github.com/fontforge/libuninameslist/" | |
330 | "archive/" version ".tar.gz")) | |
efe0be6d | 331 | (file-name (string-append name "-" version ".tar.gz")) |
f945bf06 EB |
332 | (sha256 |
333 | (base32 | |
5c85c726 | 334 | "1j6147l100rppw7axlrkdx0p35fax6bz2zh1xgpg7a3b4pmqaj3v")))) |
f945bf06 EB |
335 | (build-system gnu-build-system) |
336 | (native-inputs `(("autoconf" ,autoconf) | |
337 | ("automake" ,automake) | |
3246cc91 | 338 | ("libtool" ,libtool))) |
f945bf06 | 339 | (arguments |
722ec722 MW |
340 | `(#:phases (alist-cons-after |
341 | 'unpack 'bootstrap | |
f945bf06 EB |
342 | (lambda _ |
343 | (zero? (system* "autoreconf" "-vi"))) | |
344 | %standard-phases))) | |
345 | (synopsis "Unicode names and annotation list") | |
346 | (description | |
347 | "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be | |
348 | useful for programs that need Unicode \"Names\", \"Annotations\", and block | |
349 | definitions.") | |
350 | (license license:gpl2) | |
351 | (home-page "https://github.com/fontforge/libuninameslist"))) | |
0c115d8c EB |
352 | |
353 | (define-public fontforge | |
354 | (package | |
355 | (name "fontforge") | |
56586557 | 356 | (version "20150824") |
0c115d8c EB |
357 | (source (origin |
358 | (method url-fetch) | |
56586557 AE |
359 | (uri (string-append |
360 | "https://github.com/fontforge/fontforge/releases/download/" | |
361 | version "/fontforge-" version ".tar.gz")) | |
0c115d8c | 362 | (sha256 (base32 |
56586557 | 363 | "0gfcm8yn1d30giqhdwbchnfnspcqypqdzrxlhqhwy1i18wgl0v2v")))) |
0c115d8c | 364 | (build-system gnu-build-system) |
56586557 AE |
365 | (native-inputs |
366 | `(("pkg-config" ,pkg-config))) | |
367 | (inputs `(("cairo" ,cairo) | |
368 | ("fontconfig" ,fontconfig) ;dlopen'd | |
369 | ("freetype" ,freetype) | |
370 | ("gettext" ,gnu-gettext) | |
0c115d8c | 371 | ("giflib" ,giflib) ;needs giflib 4.* |
56586557 | 372 | ("glib" ,glib) ;needed for pango detection |
0c115d8c EB |
373 | ("libICE" ,libice) |
374 | ("libSM" ,libsm) | |
56586557 AE |
375 | ("libX11" ,libx11) |
376 | ("libXi" ,libxi) | |
377 | ("libjpeg" ,libjpeg) | |
378 | ("libltdl" ,libltdl) | |
379 | ("libpng" ,libpng) | |
0c115d8c | 380 | ("libspiro" ,libspiro) |
56586557 | 381 | ("libtiff" ,libtiff) |
0c115d8c | 382 | ("libuninameslist" ,libuninameslist) |
56586557 AE |
383 | ("libxft" ,libxft) |
384 | ("libxml2" ,libxml2) | |
0c115d8c | 385 | ("pango" ,pango) |
56586557 AE |
386 | ("potrace" ,potrace) |
387 | ("python" ,python) | |
388 | ("zlib" ,zlib))) | |
0c115d8c | 389 | (arguments |
56586557 | 390 | '(#:tests? #f |
0c115d8c EB |
391 | #:phases |
392 | (alist-cons-before | |
393 | 'configure 'patch-configure | |
394 | (lambda* (#:key inputs #:allow-other-keys) | |
395 | (let ((libxml2 (assoc-ref inputs "libxml2")) | |
396 | (cairo (assoc-ref inputs "cairo")) | |
397 | (pango (assoc-ref inputs "pango"))) | |
398 | (substitute* "configure" | |
399 | ;; configure looks for a directory to be present to determine | |
400 | ;; whether libxml2 is available, rather than checking for the | |
401 | ;; library or headers. Point it to the correct directory. | |
402 | (("/usr/include/libxml2") | |
403 | (string-append libxml2 "/include/libxml2")) | |
404 | ;; Similary, the search directories for cairo and pango are | |
405 | ;; hard-coded. | |
406 | (("gww_prefix in.*") (string-append "gww_prefix in " | |
407 | cairo " " pango "\n"))))) | |
408 | (alist-cons-after | |
409 | 'install 'set-library-path | |
410 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
411 | (let ((out (assoc-ref outputs "out")) | |
412 | (potrace (string-append (assoc-ref inputs "potrace") "/bin"))) | |
413 | (wrap-program (string-append out "/bin/fontforge") | |
414 | ;; Fontforge dynamically opens libraries. | |
415 | `("LD_LIBRARY_PATH" ":" prefix | |
416 | ,(map (lambda (input) | |
417 | (string-append (assoc-ref inputs input) | |
418 | "/lib")) | |
419 | '("libtiff" "libjpeg" "libpng" "giflib" | |
420 | "libxml2" "zlib" "libspiro" "freetype" | |
421 | "pango" "cairo" "fontconfig"))) | |
422 | ;; Checks for potrace program at runtime | |
423 | `("PATH" ":" prefix (,potrace))))) | |
424 | %standard-phases)))) | |
425 | (synopsis "Outline font editor") | |
426 | (description | |
427 | "FontForge allows you to create and modify postscript, truetype and | |
428 | opentype fonts. You can save fonts in many different outline formats, and | |
429 | generate bitmaps.") | |
56586557 | 430 | (license license:gpl3+) |
0c115d8c | 431 | (home-page "http://fontforge.org/"))) |