blob: 2b61ce81da904f10c872622320a4f6670e92a5b1 [file] [log] [blame]
Nathan Willis9f4b3752018-10-29 17:10:53 -05001<?xml version="1.0"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
5 <!ENTITY version SYSTEM "version.xml">
6]>
Khaled Hosnyd25317f2015-12-23 01:29:48 +04007<chapter id="install-harfbuzz">
Nathan Willis97c1c462018-10-10 16:38:22 -05008 <title>Installing HarfBuzz</title>
9
Khaled Hosnyd25317f2015-12-23 01:29:48 +040010 <section id="download">
Nathan Willis97c1c462018-10-10 16:38:22 -050011 <title id="download.title">Downloading HarfBuzz</title>
Khaled Hosnyd25317f2015-12-23 01:29:48 +040012 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050013 The HarfBuzz source code is hosted at <ulink
14 url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz</ulink>. The
15 same source tree is also available at the
16 <ulink
17 url="http://cgit.freedesktop.org/harfbuzz/">Freedesktop.org</ulink>
18 site.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040019 </para>
20 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050021 Tarball releases and Win32 binary bundles (which include the
22 libharfbuzz DLL, hb-view.exe, hb-shape.exe, and all
23 dependencies) of HarfBuzz can be downloaded from <ulink
24 url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz/releases</ulink>
25 or from
26 <ulink url="http://www.freedesktop.org/software/harfbuzz/release/">Freedesktop.org</ulink>.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040027 </para>
28 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050029 Release notes are posted with each new release to provide an
30 overview of the changes. The project <ulink url="https://github.com/harfbuzz/harfbuzz/issues">tracks bug
31 reports and other issues</ulink> on GitHub. Discussion and
32 questions are welcome on the <ulink
33 url="http://freedesktop.org/mailman/listinfo/harfbuzz/">HarfBuzz
34 mailing list</ulink>.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040035 </para>
36 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050037 The API included in the <filename
38 class='headerfile'>hb.h</filename> file will not change in a
39 compatibility-breaking way in any release. However, other,
40 peripheral headers are more likely to go through minor
41 modifications. We will do our best to never change APIs in an
42 incompatible way. We will <emphasis>never</emphasis> break the ABI.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040043 </para>
44 </section>
Nathan Willis97c1c462018-10-10 16:38:22 -050045
Khaled Hosnyd25317f2015-12-23 01:29:48 +040046 <section id="building">
Nathan Willis97c1c462018-10-10 16:38:22 -050047 <title>Building HarfBuzz</title>
48
49 <section id="building.linux">
50 <title>Building on Linux</title>
Khaled Hosnyd25317f2015-12-23 01:29:48 +040051 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050052 <emphasis>(1)</emphasis> To build HarfBuzz on Linux, you must first install the
53 development packages for FreeType, Cairo, and GLib. The exact
54 commands required for this step will vary depending on
55 the Linux distribution you use.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040056 </para>
57 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050058 For example, on an Ubuntu or Debian system, you would run:
59 <programlisting>
Nathan Willisad954872018-12-03 12:49:44 -060060 <command>sudo apt install</command> <package>gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev</package>
Nathan Willis97c1c462018-10-10 16:38:22 -050061 </programlisting>
62 On Fedora, RHEL, CentOS, or other Red-Hat&ndash;based systems, you would run:
63 <programlisting>
64 <command>sudo yum install</command> <package>gcc gcc-c++ freetype-devel glib2-devel cairo-devel</package>
65 </programlisting>
66
67 </para>
68
69 <para>
70 <emphasis>(2)</emphasis> The next step depends on whether you
71 are building from the source in a downloaded release tarball or
72 from the source directly from the git repository.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040073 </para>
74 <para>
Nathan Willis97c1c462018-10-10 16:38:22 -050075 <emphasis>(2)(a)</emphasis> If you downloaded the HarfBuzz
76 source code in a tarball, you can now extract the source.
Khaled Hosnyd25317f2015-12-23 01:29:48 +040077 </para>
Nathan Willis97c1c462018-10-10 16:38:22 -050078 <para>
79 From a shell in the top-level directory of the extracted source
80 code, you can run <command>./configure</command> followed by
81 <command>make</command> as with any other standard package.
82 </para>
83 <para>
84 This should leave you with a shared
85 library in the <filename>src/</filename> directory, and a few
86 utility programs including <command>hb-view</command> and
87 <command>hb-shape</command> under the <filename>util/</filename>
88 directory.
89 </para>
90 <para>
91 <emphasis>(2)(b)</emphasis> If you are building from the source in the HarfBuzz git
92 repository, rather than installing from a downloaded tarball
93 release, then you must install two more auxiliary tools before you
94 can build for the first time: <package>pkg-config</package> and
95 <ulink url="http://www.complang.org/ragel/">ragel</ulink>.
96 </para>
97 <para>
98 On Ubuntu or Debian, run:
99 <programlisting>
100 <command>sudo apt-get install</command> <package>autoconf automake libtool pkg-config ragel gtk-doc-tools</package>
101 </programlisting>
102 On Fedora, RHEL, CentOS, run:
103 <programlisting>
104 <command>sudo yum install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
105 </programlisting>
106
107 </para>
108 <para>
109 With <package>pkg-config</package> and <package>ragel</package>
110 installed, you can now run <command>./autogen.sh</command>,
111 followed by <command>./configure</command> and
112 <command>make</command> to build HarfBuzz.
113 </para>
114 </section>
115
116
117 <section id="building.windows">
118 <title>Building on Windows</title>
119
120 <para>
121 On Windows, consider using Microsoft's free <ulink
122 url="https://github.com/Microsoft/vcpkg">vcpkg</ulink> utility
123 to build HarfBuzz, its dependencies, and other open-source
124 libraries.
125 </para>
126 <para>
127 If you need to build HarfBuzz from source, first put the
Nathan Willised13cad2018-11-28 13:48:38 -0600128 <package>ragel</package> binary on your
Nathan Willis97c1c462018-10-10 16:38:22 -0500129 <literal>PATH</literal>, then follow the appveyor CI cmake
130 <ulink
131 url="https://github.com/harfbuzz/harfbuzz/blob/master/appveyor.yml">build
132 instructions</ulink>.
133 </para>
134 </section>
135
136
137 <section id="building.macos">
138 <title>Building on macOS</title>
139
140 <para>
141 There are two ways to build HarfBuzz on Mac systems: MacPorts
142 and Homebrew. The process is similar to the process used on a
143 Linux system.
144 </para>
145 <para>
146 <emphasis>(1)</emphasis> You must first install the
147 development packages for FreeType, Cairo, and GLib. If you are
148 using MacPorts, you should run:
149 <programlisting>
150 <command>sudo port install</command> <package>freetype glib2 cairo</package>
151 </programlisting>
152 </para>
153 <para>
154 If you are using Homebrew, you should run:
155 <programlisting>
156 <command>brew install</command> <package>freetype glib cairo</package>
157 </programlisting>
158 </para>
159 <para>
160 <emphasis>(2)</emphasis> The next step depends on whether you are building from the
161 source in a downloaded release tarball or from the source directly
162 from the git repository.
163 </para>
164 <para>
165 <emphasis>(2)(a)</emphasis> If you are installing HarfBuzz
166 from a downloaded tarball release, extract the tarball and
167 open a Terminal in the extracted source-code directory. Run:
168 <programlisting>
169 <command>./configure</command>
170 </programlisting>
171 followed by:
172 <programlisting>
173 <command>make</command>
174 </programlisting>
175 to build HarfBuzz.
176 </para>
177 <para>
178 <emphasis>(2)(b)</emphasis> Alternatively, if you are building
179 HarfBuzz from the source in the HarfBuzz git repository, then
180 you must install several built-time dependencies before
181 proceeding.
182 </para>
183 <para>If you are
184 using MacPorts, you should run:
185 <programlisting>
Nathan Willisad954872018-12-03 12:49:44 -0600186 <command>sudo port install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
Nathan Willis97c1c462018-10-10 16:38:22 -0500187 </programlisting>
188 to install the build dependencies.
189 </para>
190 <para>If you are using Homebrew, you should run:
191 <programlisting>
192 <command>brew install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
193 </programlisting>
194 Finally, you can run:
195 <programlisting>
196 <command>./autogen.sh</command>
197 </programlisting>
198 </para>
199 <para>
200 <emphasis>(3)</emphasis> You can now build HarfBuzz (on either
201 a MacPorts or a Homebrew system) by running:
202 <programlisting>
203 <command>./configure</command>
204 </programlisting>
205 followed by:
206 <programlisting>
207 <command>make</command>
208 </programlisting>
209 </para>
210 <para>
211 This should leave you with a shared
212 library in the <filename>src/</filename> directory, and a few
213 utility programs including <command>hb-view</command> and
214 <command>hb-shape</command> under the <filename>util/</filename>
215 directory.
216 </para>
217
218 </section>
219
Nathan Willis325e2742018-10-10 17:01:21 -0500220 <section id="configuration">
221 <title>Configuration options</title>
222
223 <para>
224 The instructions in the "Building HarfBuzz" section will build
225 the source code under its default configuration. If needed,
226 the following additional configuration options are available.
227 </para>
228
229 <variablelist>
Nathan Willised13cad2018-11-28 13:48:38 -0600230 <?dbfo list-presentation="blocks"?>
Nathan Willis325e2742018-10-10 17:01:21 -0500231 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600232 <term><command>--with-libstdc++</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500233 <listitem>
234 <para>
235 Allow linking with libstdc++. <emphasis>(Default = no)</emphasis>
236 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500237 <para>
238 This option enables or disables linking HarfBuzz to the
239 system's libstdc++ library.
240 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500241 </listitem>
242 </varlistentry>
243
244 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600245 <term><command>--with-glib</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500246 <listitem>
247 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500248 Use <ulink url="https://developer.gnome.org/glib/">GLib</ulink>. <emphasis>(Default = auto)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400249 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500250 <para>
251 This option enables or disables usage of the GLib
252 library. The default setting is to check for the
253 presence of GLib and, if it is found, build with
254 GLib support. GLib is native to GNU/Linux systems but is
255 available on other operating system as well.
256 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500257 </listitem>
258 </varlistentry>
259
260 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600261 <term><command>--with-gobject</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500262 <listitem>
263 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500264 Use <ulink url="https://developer.gnome.org/gobject/stable/">GObject</ulink>. <emphasis>(Default = no)</emphasis>
265 </para>
266 <para>
267 This option enables or disables usage of the GObject
268 library. The default setting is to check for the
269 presence of GObject and, if it is found, build with
270 GObject support. GObject is native to GNU/Linux systems but is
271 available on other operating system as well.
272 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500273 </listitem>
274 </varlistentry>
275
276 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600277 <term><command>--with-cairo</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500278 <listitem>
279 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500280 Use <ulink url="https://cairographics.org/">Cairo</ulink>. <emphasis>(Default = auto)</emphasis>
281 </para>
282 <para>
283 This option enables or disables usage of the Cairo
284 graphics-rendering library. The default setting is to
285 check for the presence of Cairo and, if it is found,
286 build with Cairo support.
Nathan Willis01400f72018-10-20 17:21:49 +0100287 </para>
288 <para>
289 Note: Cairo is used only by the HarfBuzz
290 command-line utilities, and not by the HarfBuzz library.
291 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500292 </listitem>
293 </varlistentry>
294
295 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600296 <term><command>--with-fontconfig</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500297 <listitem>
298 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500299 Use <ulink url="https://www.freedesktop.org/wiki/Software/fontconfig/">Fontconfig</ulink>. <emphasis>(Default = auto)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400300 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500301 <para>
302 This option enables or disables usage of the Fontconfig
303 library, which provides font-matching functions and
304 provides access to font properties. The default setting
305 is to check for the presence of Fontconfig and, if it is
306 found, build with Fontconfig support.
307 </para>
Nathan Willis01400f72018-10-20 17:21:49 +0100308 <para>
309 Note: Fontconfig is used only by the HarfBuzz
310 command-line utilities, and not by the HarfBuzz library.
311 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500312 </listitem>
313 </varlistentry>
314
315 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600316 <term><command>--with-icu</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500317 <listitem>
318 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500319 Use the <ulink url="http://site.icu-project.org/home">ICU</ulink> library. <emphasis>(Default = auto)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400320 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500321 <para>
322 This option enables or disables usage of the
323 <emphasis>International Components for
324 Unicode</emphasis> (ICU) library, which provides access
325 to Unicode Character Database (UCD) properties as well
326 as normalization and conversion functions. The default
327 setting is to check for the presence of ICU and, if it
328 is found, build with ICU support.
329 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500330 </listitem>
331 </varlistentry>
332
333 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600334 <term><command>--with-graphite2</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500335 <listitem>
336 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500337 Use the <ulink url="http://graphite.sil.org/">Graphite2</ulink> library. <emphasis>(Default = no)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400338 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500339 <para>
340 This option enables or disables usage of the Graphite2
341 library, which provides support for the Graphite shaping
342 model.
343 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500344 </listitem>
345 </varlistentry>
346
347 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600348 <term><command>--with-freetype</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500349 <listitem>
350 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500351 Use the <ulink url="https://www.freetype.org/">FreeType</ulink> library. <emphasis>(Default = auto)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400352 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500353 <para>
354 This option enables or disables usage of the FreeType
355 font-rendering library. The default setting is to check for the
356 presence of FreeType and, if it is found, build with
357 FreeType support.
358 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500359 </listitem>
360 </varlistentry>
361
362 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600363 <term><command>--with-uniscribe</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500364 <listitem>
365 <para>
Nathan Willis9f4b3752018-10-29 17:10:53 -0500366 Use the <ulink
367 url="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe">Uniscribe</ulink>
368 library (experimental). <emphasis>(Default = no)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400369 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500370 <para>
371 This option enables or disables usage of the Uniscribe
Nathan Willis9f4b3752018-10-29 17:10:53 -0500372 font-rendering library. Uniscribe is available on
373 Windows systems. Uniscribe support is used only for
374 testing purposes and does not need to be enabled for
375 HarfBuzz to run on Windows systems.
Nathan Willis792af5d2018-10-11 14:05:59 -0500376 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500377 </listitem>
378 </varlistentry>
379
380 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600381 <term><command>--with-directwrite</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500382 <listitem>
383 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500384 Use the <ulink url="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal">DirectWrite</ulink> library (experimental). <emphasis>(Default = no)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400385 </para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500386 <para>
387 This option enables or disables usage of the DirectWrite
Nathan Willis9f4b3752018-10-29 17:10:53 -0500388 font-rendering library. DirectWrite is available on
389 Windows systems. DirectWrite support is used only for
390 testing purposes and does not need to be enabled for
391 HarfBuzz to run on Windows systems.
Nathan Willis792af5d2018-10-11 14:05:59 -0500392 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500393 </listitem>
394 </varlistentry>
395
396 <varlistentry>
Nathan Willisad954872018-12-03 12:49:44 -0600397 <term><command>--with-coretext</command></term>
Nathan Willis325e2742018-10-10 17:01:21 -0500398 <listitem>
399 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500400 Use the <ulink url="https://developer.apple.com/documentation/coretext">CoreText</ulink> library. <emphasis>(Default = no)</emphasis>
Behdad Esfahbodb567d4e2019-05-23 21:36:42 -0400401 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500402 <para>
Nathan Willis792af5d2018-10-11 14:05:59 -0500403 This option enables or disables usage of the CoreText
404 library. CoreText is available on macOS and iOS systems.
405 </para>
Nathan Willis325e2742018-10-10 17:01:21 -0500406 </listitem>
Nathan Willis792af5d2018-10-11 14:05:59 -0500407 </varlistentry>
Alfie John2144ca92019-01-21 04:47:05 +0000408
409 <varlistentry>
410 <term><command>--enable-gtk-doc</command></term>
411 <listitem>
412 <para>
413 Use <ulink url="https://www.gtk.org/gtk-doc/">GTK-Doc</ulink>. <emphasis>(Default = no)</emphasis>
414 </para>
415 <para>
416 This option enables the building of the documentation.
417 </para>
418 </listitem>
419 </varlistentry>
Nathan Willis325e2742018-10-10 17:01:21 -0500420 </variablelist>
421 </section>
Nathan Willis97c1c462018-10-10 16:38:22 -0500422
Khaled Hosnyd25317f2015-12-23 01:29:48 +0400423 </section>
424</chapter>