1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages fontutils)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages ghostscript)
24 #:use-module (gnu packages perl)
25 #:use-module (gnu packages pkg-config)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages gettext)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages xorg)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages xml)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu))
40 (define-public freetype
46 (uri (string-append "mirror://savannah/freetype/freetype-"
49 "1fdgl7js99xv1yy5zx1ravmqd0jxlnqpv7zcl954h4hbg15wqyrq"))))
50 (build-system gnu-build-system)
53 ;; This should not be necessary; reported upstream as
54 ;; https://savannah.nongnu.org/bugs/index.php?44261
58 (setenv "CONFIG_SHELL" (which "bash")))
60 (synopsis "Font rendering library")
62 "Freetype is a library that can be used by applications to access the
63 contents of font files. It provides a uniform interface to access font files.
64 It supports both bitmap and scalable formats, including TrueType, OpenType,
65 Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. It supports high-speed
66 anti-aliased glyph bitmap generation with 256 gray levels.")
67 (license license:freetype) ; some files have other licenses
68 (home-page "http://www.freetype.org/")))
70 (define-public fontconfig
77 "http://www.freedesktop.org/software/fontconfig/release/fontconfig-"
80 "18r45dcnaj93izwfr082qiwg8ka7ll6j0c9yf1slblm542d5pmd9"))))
81 (build-system gnu-build-system)
82 (propagated-inputs `(("expat" ,expat)
83 ("freetype" ,freetype)))
84 (inputs `(("gs-fonts" ,gs-fonts)))
86 `(("pkg-config" ,pkg-config)))
89 ;; point to user profile instead of /usr/share/fonts in /etc/fonts.conf
90 (list "--with-default-fonts=~/.guix-profile/share/fonts"
92 (string-append "--with-add-fonts="
93 (assoc-ref %build-inputs "gs-fonts")
95 (synopsis "Library for configuring and customizing font access")
97 "Fontconfig can discover new fonts when installed automatically;
98 perform font name substitution, so that appropriate alternative fonts can
99 be selected if fonts are missing;
100 identify the set of fonts required to completely cover a set of languages;
101 have GUI configuration tools built as it uses an XML-based configuration file;
102 efficiently and quickly find needed fonts among the set of installed fonts;
103 be used in concert with the X Render Extension and FreeType to implement
104 high quality, anti-aliased and subpixel rendered text on a display.")
105 ; The exact license is more X11-style than BSD-style.
106 (license (license:non-copyleft "file://COPYING"
107 "See COPYING in the distribution."))
108 (home-page "http://www.freedesktop.org/wiki/Software/fontconfig")))
116 (uri "ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz")
118 "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2"))))
119 (build-system gnu-build-system)
121 ;; Making the documentation requires latex, but t1lib is also an input
122 ;; for building texlive.
123 `(#:tests? #f ; no test target
126 (synopsis "Library for generating bitmaps from Type 1 fonts")
128 "T1lib is a library for generating/rasterising bitmaps from Type 1 fonts.
129 It is based on the code of the X11 rasteriser of the X11 project.
131 The bitmaps created by t1lib are returned in a data structure with type
132 GLYPH. This special GLYPH-type is also used in the X11 window system to
133 describe character bitmaps. It contains the bitmap data as well as some
134 metric information. But t1lib is in itself entirely independent of the
135 X11-system or any other graphical user interface.")
136 (license license:gpl2)
137 (home-page "http://www.t1lib.org/")))
139 (define-public teckit
147 "http://scripts.sil.org/svn-view/teckit/TAGS/TECkit_"
148 (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
150 "http://pkgs.fedoraproject.org/repo/pkgs/teckit/TECkit_2_5_1.tar.gz/4913f71f0f42bfd9cf8f161688b35dea/TECkit_2_5_1.tar.gz"
151 ;; This used to be the canonical URL but it vanished.
152 ;; See <http://bugs.gnu.org/19600>.
154 ;; "http://scripts.sil.org/svn-view/teckit/TAGS/TECkit_"
155 ;; (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version)
159 "0fjiwvic8mdxpkyccfp7zh26y9xnvkp0skqbyfkrjiacd191k82r"))
160 (patches (list (search-patch "teckit-cstdio.patch")))))
161 (build-system gnu-build-system)
162 (inputs `(("zlib" ,zlib)))
163 (synopsis "Toolkit for encoding conversions")
165 "TECkit is a low-level toolkit intended to be used by other applications
166 that need to perform encoding conversions (e.g., when importing legacy data
167 into a Unicode-based application). The primary component of the TECkit
168 package is therefore a library that performs conversions; this is the
169 \"TECkit engine\". The engine relies on mapping tables in a specific binary
170 format (for which documentation is available); there is a compiler that
171 creates such tables from a human-readable mapping description (a simple
174 To facilitate the development and testing of mapping tables for TECkit,
175 several applications are also included in the current package; these
176 include simple tools for applying conversions to plain-text and Standard
177 Format files, as well as both command-line and simple GUI versions of the
178 TECkit compiler. However, it is not intended that these tools will be the
179 primary means by which end users perform conversions, and they have not
180 been designed, tested, and debugged to the extent that general-purpose
181 applications should be.")
182 (license license:lgpl2.1+)
183 (home-page "http://scripts.sil.org/cms/scripts/page.php?cat_id=teckit")))
185 (define-public graphite2
193 "mirror://sourceforge/silgraphite/graphite2/graphite2-"
197 "00xhv1mp640fr3wmdzwn4yz0g56jd4r9fb7b02mc1g19h0bdbhsb"))))
198 (build-system cmake-build-system)
200 `(("freetype" ,freetype)
202 ("python" ,python-2))) ; because of "import imap" in tests
203 (synopsis "Reimplementation of the SIL Graphite text processing engine")
205 "Graphite2 is a reimplementation of the SIL Graphite text processing
206 engine. Graphite is a smart font technology designed to facilitate the
207 process known as shaping. This process takes an input Unicode text string
208 and returns a sequence of positioned glyphids from the font.")
209 (license license:lgpl2.1+)
210 (home-page "http://projects.palaso.org/projects/graphitedev")))
212 (define-public potrace
219 (uri (string-append "mirror://sourceforge/potrace/potrace-"
223 "1bbyl7jgigawmwc8r14znv8lb6lrcxh8zpvynrl6s800dr4yp9as"))))
224 (build-system gnu-build-system)
225 (native-inputs `(("ghostscript" ,ghostscript))) ;for tests
226 (inputs `(("zlib" ,zlib)))
229 `("--with-libpotrace"))) ; install library and headers
230 (synopsis "Transform bitmaps into vector graphics")
232 "Potrace is a tool for tracing a bitmap, which means, transforming a
233 bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM,
234 or BMP format), and the default output is an encapsulated PostScript
235 file (EPS). A typical use is to create EPS files from scanned data, such as
236 company or university logos, handwritten notes, etc. The resulting image is
237 not \"jaggy\" like a bitmap, but smooth. It can then be rendered at any
239 (license license:gpl2+)
240 (home-page "http://potrace.sourceforge.net/")))
242 (define-public libspiro
249 (uri (string-append "mirror://sourceforge/libspiro/libspiro/"
250 version "/libspiro_src-" version ".tar.bz2"))
253 "1kylz8pvwnb85yya150r9i6mhbpzx38f32qy523qg3ylgd9b3zhy"))))
254 (build-system gnu-build-system)
255 (arguments `(#:tests? #f)) ;no tests
256 (synopsis "Clothoid to bezier conversion library")
258 "Raph Levien's Spiro package as a library. A mechanism for drawing
259 smooth contours with constant curvature at the spline joins.")
260 (license license:gpl2+)
261 (home-page "http://libspiro.sourceforge.net/")))
263 (define-public libuninameslist
265 (name "libuninameslist")
266 (version "0.4.20140731")
270 (uri (string-append "https://github.com/fontforge/libuninameslist/"
271 "archive/" version ".tar.gz"))
272 (file-name (string-append name "-" version ".tar.gz"))
275 "016zxffpc8iwpxxmnjkdirn6dsbcvdb2wjdrp123sf79f4nsynyj"))))
276 (build-system gnu-build-system)
277 (native-inputs `(("autoconf" ,autoconf)
278 ("automake" ,automake)
279 ("libtool" ,libtool)))
281 `(#:phases (alist-cons-after
284 (zero? (system* "autoreconf" "-vi")))
286 (synopsis "Unicode names and annotation list")
288 "LibUniNamesList holds www.unicode.org Nameslist.txt data which can be
289 useful for programs that need Unicode \"Names\", \"Annotations\", and block
291 (license license:gpl2)
292 (home-page "https://github.com/fontforge/libuninameslist")))
294 (define-public fontforge
297 (version "20120731-b") ;aka 1.0
300 (uri (string-append "mirror://sourceforge/fontforge/fontforge_full-"
303 "1dhg0i2pf76j40cb9g1wzpag21fgarpjaad0hdbk27i1zz588q8v"))))
304 (build-system gnu-build-system)
305 ;; TODO: Add python for scripting support.
306 (inputs `(("gettext" ,gnu-gettext)
310 ("giflib" ,giflib) ;needs giflib 4.*
316 ("freetype" ,freetype)
318 ("libspiro" ,libspiro)
321 ("fontconfig" ,fontconfig) ;dlopen'd
322 ("libuninameslist" ,libuninameslist)
324 ("glib" ,glib))) ;needed for pango detection
326 '(#:configure-flags `("--enable-double")
330 'configure 'patch-configure
331 (lambda* (#:key inputs #:allow-other-keys)
332 (let ((libxml2 (assoc-ref inputs "libxml2"))
333 (cairo (assoc-ref inputs "cairo"))
334 (pango (assoc-ref inputs "pango")))
335 (substitute* "configure"
336 ;; configure looks for a directory to be present to determine
337 ;; whether libxml2 is available, rather than checking for the
338 ;; library or headers. Point it to the correct directory.
339 (("/usr/include/libxml2")
340 (string-append libxml2 "/include/libxml2"))
341 ;; Similary, the search directories for cairo and pango are
343 (("gww_prefix in.*") (string-append "gww_prefix in "
344 cairo " " pango "\n")))))
346 'install 'set-library-path
347 (lambda* (#:key inputs outputs #:allow-other-keys)
348 (let ((out (assoc-ref outputs "out"))
349 (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
350 (wrap-program (string-append out "/bin/fontforge")
351 ;; Fontforge dynamically opens libraries.
352 `("LD_LIBRARY_PATH" ":" prefix
353 ,(map (lambda (input)
354 (string-append (assoc-ref inputs input)
356 '("libtiff" "libjpeg" "libpng" "giflib"
357 "libxml2" "zlib" "libspiro" "freetype"
358 "pango" "cairo" "fontconfig")))
359 ;; Checks for potrace program at runtime
360 `("PATH" ":" prefix (,potrace)))))
362 (synopsis "Outline font editor")
364 "FontForge allows you to create and modify postscript, truetype and
365 opentype fonts. You can save fonts in many different outline formats, and
367 (license license:bsd-3)
368 (home-page "http://fontforge.org/")))