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">
7 <chapter id="install-harfbuzz">
8 <title>Installing HarfBuzz</title>
10 <section id="download">
11 <title id="download.title">Downloading HarfBuzz</title>
13 The HarfBuzz source code is hosted at <ulink
14 url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz</ulink>.
17 Tarball releases and Win32 binary bundles (which include the
18 libharfbuzz DLL, hb-view.exe, hb-shape.exe, and all
19 dependencies) of HarfBuzz can be downloaded from <ulink
20 url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz/releases</ulink>.
23 Release notes are posted with each new release to provide an
24 overview of the changes. The project <ulink url="https://github.com/harfbuzz/harfbuzz/issues">tracks bug
25 reports and other issues</ulink> on GitHub. Discussion and
26 questions are welcome on the <ulink
27 url="http://freedesktop.org/mailman/listinfo/harfbuzz/">HarfBuzz
31 The API included in the <filename
32 class='headerfile'>hb.h</filename> file will not change in a
33 compatibility-breaking way in any release. However, other,
34 peripheral headers are more likely to go through minor
35 modifications. We will do our best to never change APIs in an
36 incompatible way. We will <emphasis>never</emphasis> break the ABI.
40 <section id="building">
41 <title>Building HarfBuzz</title>
43 <section id="building.linux">
44 <title>Building on Linux</title>
46 <emphasis>(1)</emphasis> To build HarfBuzz on Linux, you must first install the
47 development packages for FreeType, Cairo, and GLib. The exact
48 commands required for this step will vary depending on
49 the Linux distribution you use.
52 For example, on an Ubuntu or Debian system, you would run:
54 <command>sudo apt install</command> <package>gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev</package>
56 On Fedora, RHEL, CentOS, or other Red-Hat–based systems, you would run:
58 <command>sudo yum install</command> <package>gcc gcc-c++ freetype-devel glib2-devel cairo-devel</package>
64 <emphasis>(2)</emphasis> The next step depends on whether you
65 are building from the source in a downloaded release tarball or
66 from the source directly from the git repository.
69 <emphasis>(2)(a)</emphasis> If you downloaded the HarfBuzz
70 source code in a tarball, you can now extract the source.
73 From a shell in the top-level directory of the extracted source
74 code, you can run <command>./configure</command> followed by
75 <command>make</command> as with any other standard package.
78 This should leave you with a shared
79 library in the <filename>src/</filename> directory, and a few
80 utility programs including <command>hb-view</command> and
81 <command>hb-shape</command> under the <filename>util/</filename>
85 <emphasis>(2)(b)</emphasis> If you are building from the source in the HarfBuzz git
86 repository, rather than installing from a downloaded tarball
87 release, then you must install two more auxiliary tools before you
88 can build for the first time: <package>pkg-config</package> and
89 <ulink url="http://www.complang.org/ragel/">ragel</ulink>.
92 On Ubuntu or Debian, run:
94 <command>sudo apt-get install</command> <package>autoconf automake libtool pkg-config ragel gtk-doc-tools</package>
96 On Fedora, RHEL, CentOS, run:
98 <command>sudo yum install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
103 With <package>pkg-config</package> and <package>ragel</package>
104 installed, you can now run <command>./autogen.sh</command>,
105 followed by <command>./configure</command> and
106 <command>make</command> to build HarfBuzz.
111 <section id="building.windows">
112 <title>Building on Windows</title>
115 On Windows, consider using Microsoft's free <ulink
116 url="https://github.com/Microsoft/vcpkg">vcpkg</ulink> utility
117 to build HarfBuzz, its dependencies, and other open-source
121 If you need to build HarfBuzz from source, first put the
122 <package>ragel</package> binary on your
123 <literal>PATH</literal>, then follow the appveyor CI cmake
125 url="https://github.com/harfbuzz/harfbuzz/blob/master/appveyor.yml">build
126 instructions</ulink>.
131 <section id="building.macos">
132 <title>Building on macOS</title>
135 There are two ways to build HarfBuzz on Mac systems: MacPorts
136 and Homebrew. The process is similar to the process used on a
140 <emphasis>(1)</emphasis> You must first install the
141 development packages for FreeType, Cairo, and GLib. If you are
142 using MacPorts, you should run:
144 <command>sudo port install</command> <package>freetype glib2 cairo</package>
148 If you are using Homebrew, you should run:
150 <command>brew install</command> <package>freetype glib cairo</package>
154 <emphasis>(2)</emphasis> The next step depends on whether you are building from the
155 source in a downloaded release tarball or from the source directly
156 from the git repository.
159 <emphasis>(2)(a)</emphasis> If you are installing HarfBuzz
160 from a downloaded tarball release, extract the tarball and
161 open a Terminal in the extracted source-code directory. Run:
163 <command>./configure</command>
167 <command>make</command>
172 <emphasis>(2)(b)</emphasis> Alternatively, if you are building
173 HarfBuzz from the source in the HarfBuzz git repository, then
174 you must install several built-time dependencies before
178 using MacPorts, you should run:
180 <command>sudo port install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
182 to install the build dependencies.
184 <para>If you are using Homebrew, you should run:
186 <command>brew install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
188 Finally, you can run:
190 <command>./autogen.sh</command>
194 <emphasis>(3)</emphasis> You can now build HarfBuzz (on either
195 a MacPorts or a Homebrew system) by running:
197 <command>./configure</command>
201 <command>make</command>
205 This should leave you with a shared
206 library in the <filename>src/</filename> directory, and a few
207 utility programs including <command>hb-view</command> and
208 <command>hb-shape</command> under the <filename>util/</filename>
214 <section id="configuration">
215 <title>Configuration options</title>
218 The instructions in the "Building HarfBuzz" section will build
219 the source code under its default configuration. If needed,
220 the following additional configuration options are available.
224 <?dbfo list-presentation="blocks"?>
226 <term><command>--with-libstdc++</command></term>
229 Allow linking with libstdc++. <emphasis>(Default = no)</emphasis>
232 This option enables or disables linking HarfBuzz to the
233 system's libstdc++ library.
239 <term><command>--with-glib</command></term>
242 Use <ulink url="https://developer.gnome.org/glib/">GLib</ulink>. <emphasis>(Default = auto)</emphasis>
245 This option enables or disables usage of the GLib
246 library. The default setting is to check for the
247 presence of GLib and, if it is found, build with
248 GLib support. GLib is native to GNU/Linux systems but is
249 available on other operating system as well.
255 <term><command>--with-gobject</command></term>
258 Use <ulink url="https://developer.gnome.org/gobject/stable/">GObject</ulink>. <emphasis>(Default = no)</emphasis>
261 This option enables or disables usage of the GObject
262 library. The default setting is to check for the
263 presence of GObject and, if it is found, build with
264 GObject support. GObject is native to GNU/Linux systems but is
265 available on other operating system as well.
271 <term><command>--with-cairo</command></term>
274 Use <ulink url="https://cairographics.org/">Cairo</ulink>. <emphasis>(Default = auto)</emphasis>
277 This option enables or disables usage of the Cairo
278 graphics-rendering library. The default setting is to
279 check for the presence of Cairo and, if it is found,
280 build with Cairo support.
283 Note: Cairo is used only by the HarfBuzz
284 command-line utilities, and not by the HarfBuzz library.
290 <term><command>--with-fontconfig</command></term>
293 Use <ulink url="https://www.freedesktop.org/wiki/Software/fontconfig/">Fontconfig</ulink>. <emphasis>(Default = auto)</emphasis>
296 This option enables or disables usage of the Fontconfig
297 library, which provides font-matching functions and
298 provides access to font properties. The default setting
299 is to check for the presence of Fontconfig and, if it is
300 found, build with Fontconfig support.
303 Note: Fontconfig is used only by the HarfBuzz
304 command-line utilities, and not by the HarfBuzz library.
310 <term><command>--with-icu</command></term>
313 Use the <ulink url="http://site.icu-project.org/home">ICU</ulink> library. <emphasis>(Default = auto)</emphasis>
316 This option enables or disables usage of the
317 <emphasis>International Components for
318 Unicode</emphasis> (ICU) library, which provides access
319 to Unicode Character Database (UCD) properties as well
320 as normalization and conversion functions. The default
321 setting is to check for the presence of ICU and, if it
322 is found, build with ICU support.
328 <term><command>--with-graphite2</command></term>
331 Use the <ulink url="http://graphite.sil.org/">Graphite2</ulink> library. <emphasis>(Default = no)</emphasis>
334 This option enables or disables usage of the Graphite2
335 library, which provides support for the Graphite shaping
342 <term><command>--with-freetype</command></term>
345 Use the <ulink url="https://www.freetype.org/">FreeType</ulink> library. <emphasis>(Default = auto)</emphasis>
348 This option enables or disables usage of the FreeType
349 font-rendering library. The default setting is to check for the
350 presence of FreeType and, if it is found, build with
357 <term><command>--with-uniscribe</command></term>
361 url="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe">Uniscribe</ulink>
362 library (experimental). <emphasis>(Default = no)</emphasis>
365 This option enables or disables usage of the Uniscribe
366 font-rendering library. Uniscribe is available on
367 Windows systems. Uniscribe support is used only for
368 testing purposes and does not need to be enabled for
369 HarfBuzz to run on Windows systems.
375 <term><command>--with-directwrite</command></term>
378 Use the <ulink url="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal">DirectWrite</ulink> library (experimental). <emphasis>(Default = no)</emphasis>
381 This option enables or disables usage of the DirectWrite
382 font-rendering library. DirectWrite is available on
383 Windows systems. DirectWrite support is used only for
384 testing purposes and does not need to be enabled for
385 HarfBuzz to run on Windows systems.
391 <term><command>--with-coretext</command></term>
394 Use the <ulink url="https://developer.apple.com/documentation/coretext">CoreText</ulink> library. <emphasis>(Default = no)</emphasis>
397 This option enables or disables usage of the CoreText
398 library. CoreText is available on macOS and iOS systems.
404 <term><command>--enable-gtk-doc</command></term>
407 Use <ulink url="https://www.gtk.org/gtk-doc/">GTK-Doc</ulink>. <emphasis>(Default = no)</emphasis>
410 This option enables the building of the documentation.