1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Building HarfBuzz: HarfBuzz Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="HarfBuzz Manual">
8 <link rel="up" href="install-harfbuzz.html" title="Installing HarfBuzz">
9 <link rel="prev" href="install-harfbuzz.html" title="Installing HarfBuzz">
10 <link rel="next" href="getting-started.html" title="Getting started with HarfBuzz">
11 <meta name="generator" content="GTK-Doc V1.32 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts"></td>
17 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18 <td><a accesskey="u" href="install-harfbuzz.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19 <td><a accesskey="p" href="install-harfbuzz.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20 <td><a accesskey="n" href="getting-started.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
23 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
24 <a name="building"></a>Building HarfBuzz</h2></div></div></div>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="building.linux"></a>Building on Linux</h3></div></div></div>
29 <span class="emphasis"><em>(1)</em></span> To build HarfBuzz on Linux, you must first install the
30 development packages for FreeType, Cairo, and GLib. The exact
31 commands required for this step will vary depending on
32 the Linux distribution you use.
35 For example, on an Ubuntu or Debian system, you would run:
37 <pre class="programlisting"><span class="command"><strong>sudo apt install</strong></span> <span class="package">gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev</span></pre>
39 On Fedora, RHEL, CentOS, or other Red-Hat–based systems, you would run:
41 <pre class="programlisting"><span class="command"><strong>sudo yum install</strong></span> <span class="package">gcc gcc-c++ freetype-devel glib2-devel cairo-devel</span></pre>
46 <span class="emphasis"><em>(2)</em></span> The next step depends on whether you
47 are building from the source in a downloaded release tarball or
48 from the source directly from the git repository.
51 <span class="emphasis"><em>(2)(a)</em></span> If you downloaded the HarfBuzz
52 source code in a tarball, you can now extract the source.
55 From a shell in the top-level directory of the extracted source
56 code, you can run <span class="command"><strong>meson build</strong></span> followed by
57 <span class="command"><strong>meson compile -C build</strong></span> as with any other standard package.
60 This should leave you with a shared
61 library in the <code class="filename">src/</code> directory, and a few
62 utility programs including <span class="command"><strong>hb-view</strong></span> and
63 <span class="command"><strong>hb-shape</strong></span> under the <code class="filename">util/</code>
67 <span class="emphasis"><em>(2)(b)</em></span> If you are building from the source in the HarfBuzz git
68 repository, rather than installing from a downloaded tarball
69 release, then you must install two more auxiliary tools before you
70 can build for the first time: <span class="package">pkg-config</span>.
73 On Ubuntu or Debian, run:
75 <pre class="programlisting"><span class="command"><strong>sudo apt-get install</strong></span> <span class="package">meson pkg-config gtk-doc-tools</span></pre>
77 On Fedora, RHEL, CentOS, run:
79 <pre class="programlisting"><span class="command"><strong>sudo yum install</strong></span> <span class="package">meson pkgconfig gtk-doc</span></pre>
84 With <span class="package">pkg-config</span> installed, you can now run
85 <span class="command"><strong>meson build</strong></span> then
86 <span class="command"><strong>meson compile -C build</strong></span> to build HarfBuzz.
90 <div class="titlepage"><div><div><h3 class="title">
91 <a name="building.windows"></a>Building on Windows</h3></div></div></div>
93 <a class="ulink" href="https://mesonbuild.com/Getting-meson.html" target="_top">Install meson</a>
94 and run (from the console) <span class="command"><strong>meson build</strong></span> (by default
95 bundled dependencies are not built, <span class="command"><strong>--wrap-mode=default</strong></span>
96 overrides this), then <span class="command"><strong>meson compile -C build</strong></span> to
100 <div class="section">
101 <div class="titlepage"><div><div><h3 class="title">
102 <a name="building.macos"></a>Building on macOS</h3></div></div></div>
104 There are two ways to build HarfBuzz on Mac systems: MacPorts
105 and Homebrew. The process is similar to the process used on a
109 <span class="emphasis"><em>(1)</em></span> You must first install the
110 development packages for FreeType, Cairo, and GLib. If you are
111 using MacPorts, you should run:
113 <pre class="programlisting"><span class="command"><strong>sudo port install</strong></span> <span class="package">freetype glib2 cairo</span></pre>
117 If you are using Homebrew, you should run:
119 <pre class="programlisting"><span class="command"><strong>brew install</strong></span> <span class="package">freetype glib cairo</span></pre>
123 <span class="emphasis"><em>(2)</em></span> The next step depends on whether you are building from the
124 source in a downloaded release tarball or from the source directly
125 from the git repository.
128 <span class="emphasis"><em>(2)(a)</em></span> If you are installing HarfBuzz
129 from a downloaded tarball release, extract the tarball and
130 open a Terminal in the extracted source-code directory. Run:
132 <pre class="programlisting"><span class="command"><strong>meson build</strong></span></pre>
136 <pre class="programlisting"><span class="command"><strong>meson compile -C build</strong></span></pre>
141 <span class="emphasis"><em>(2)(b)</em></span> Alternatively, if you are building
142 HarfBuzz from the source in the HarfBuzz git repository, then
143 you must install several built-time dependencies before
147 using MacPorts, you should run:
149 <pre class="programlisting"><span class="command"><strong>sudo port install</strong></span> <span class="package">meson pkgconfig gtk-doc</span></pre>
151 to install the build dependencies.
153 <p>If you are using Homebrew, you should run:
155 <pre class="programlisting"><span class="command"><strong>brew install</strong></span> <span class="package">meson pkgconfig gtk-doc</span></pre>
157 Finally, you can run:
159 <pre class="programlisting"><span class="command"><strong>meson build</strong></span></pre>
163 <span class="emphasis"><em>(3)</em></span> You can now build HarfBuzz (on either
164 a MacPorts or a Homebrew system) by running:
166 <pre class="programlisting"><span class="command"><strong>meson build</strong></span></pre>
170 <pre class="programlisting"><span class="command"><strong>meson compile -C build</strong></span></pre>
174 This should leave you with a shared
175 library in the <code class="filename">src/</code> directory, and a few
176 utility programs including <span class="command"><strong>hb-view</strong></span> and
177 <span class="command"><strong>hb-shape</strong></span> under the <code class="filename">util/</code>
181 <div class="section">
182 <div class="titlepage"><div><div><h3 class="title">
183 <a name="configuration"></a>Configuration options</h3></div></div></div>
185 The instructions in the "Building HarfBuzz" section will build
186 the source code under its default configuration. If needed,
187 the following additional configuration options are available.
189 <div class="variablelist"><table border="0" class="variablelist">
191 <col align="left" valign="top">
196 <td><p><span class="term"><span class="command"><strong>-Dglib=enabled</strong></span></span></p></td>
199 Use <a class="ulink" href="https://developer.gnome.org/glib/" target="_top">GLib</a>. <span class="emphasis"><em>(Default = auto)</em></span>
202 This option enables or disables usage of the GLib
203 library. The default setting is to check for the
204 presence of GLib and, if it is found, build with
205 GLib support. GLib is native to GNU/Linux systems but is
206 available on other operating system as well.
211 <td><p><span class="term"><span class="command"><strong>-Dgobject=enabled</strong></span></span></p></td>
214 Use <a class="ulink" href="https://developer.gnome.org/gobject/stable/" target="_top">GObject</a>. <span class="emphasis"><em>(Default = no)</em></span>
217 This option enables or disables usage of the GObject
218 library. The default setting is to check for the
219 presence of GObject and, if it is found, build with
220 GObject support. GObject is native to GNU/Linux systems but is
221 available on other operating system as well.
226 <td><p><span class="term"><span class="command"><strong>-Dcairo=enabled</strong></span></span></p></td>
229 Use <a class="ulink" href="https://cairographics.org/" target="_top">Cairo</a>. <span class="emphasis"><em>(Default = auto)</em></span>
232 This option enables or disables usage of the Cairo
233 graphics-rendering library. The default setting is to
234 check for the presence of Cairo and, if it is found,
235 build with Cairo support.
238 Note: Cairo is used only by the HarfBuzz
239 command-line utilities, and not by the HarfBuzz library.
244 <td><p><span class="term"><span class="command"><strong>-Dicu=enabled</strong></span></span></p></td>
247 Use the <a class="ulink" href="http://site.icu-project.org/home" target="_top">ICU</a> library. <span class="emphasis"><em>(Default = auto)</em></span>
250 This option enables or disables usage of the
251 <span class="emphasis"><em>International Components for
252 Unicode</em></span> (ICU) library, which provides access
253 to Unicode Character Database (UCD) properties as well
254 as normalization and conversion functions. The default
255 setting is to check for the presence of ICU and, if it
256 is found, build with ICU support.
261 <td><p><span class="term"><span class="command"><strong>-Dgraphite=enabled</strong></span></span></p></td>
264 Use the <a class="ulink" href="http://graphite.sil.org/" target="_top">Graphite2</a> library. <span class="emphasis"><em>(Default = no)</em></span>
267 This option enables or disables usage of the Graphite2
268 library, which provides support for the Graphite shaping
274 <td><p><span class="term"><span class="command"><strong>-Dfreetype=enabled</strong></span></span></p></td>
277 Use the <a class="ulink" href="https://www.freetype.org/" target="_top">FreeType</a> library. <span class="emphasis"><em>(Default = auto)</em></span>
280 This option enables or disables usage of the FreeType
281 font-rendering library. The default setting is to check for the
282 presence of FreeType and, if it is found, build with
288 <td><p><span class="term"><span class="command"><strong>-Dgdi=enabled</strong></span></span></p></td>
291 Use the <a class="ulink" href="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe" target="_top">Uniscribe</a>
292 library (experimental). <span class="emphasis"><em>(Default = no)</em></span>
295 This option enables or disables usage of the Uniscribe
296 font-rendering library. Uniscribe is available on
297 Windows systems. Uniscribe support is used only for
298 testing purposes and does not need to be enabled for
299 HarfBuzz to run on Windows systems.
304 <td><p><span class="term"><span class="command"><strong>-Ddirectwrite=enabled</strong></span></span></p></td>
307 Use the <a class="ulink" href="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal" target="_top">DirectWrite</a> library (experimental). <span class="emphasis"><em>(Default = no)</em></span>
310 This option enables or disables usage of the DirectWrite
311 font-rendering library. DirectWrite is available on
312 Windows systems. DirectWrite support is used only for
313 testing purposes and does not need to be enabled for
314 HarfBuzz to run on Windows systems.
319 <td><p><span class="term"><span class="command"><strong>-Dcoretext=enabled</strong></span></span></p></td>
322 Use the <a class="ulink" href="https://developer.apple.com/documentation/coretext" target="_top">CoreText</a> library. <span class="emphasis"><em>(Default = no)</em></span>
325 This option enables or disables usage of the CoreText
326 library. CoreText is available on macOS and iOS systems.
331 <td><p><span class="term"><span class="command"><strong>-Ddocs=enabled</strong></span></span></p></td>
334 Use <a class="ulink" href="https://github.com/GNOME/gtk-doc" target="_top">GTK-Doc</a>. <span class="emphasis"><em>(Default = no)</em></span>
337 This option enables the building of the documentation.
346 <hr>Generated by GTK-Doc V1.32</div>