usermanual-install-harfbuzz.xml 14.9 KB
Newer Older
1 2 3 4 5 6
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
  <!ENTITY version SYSTEM "version.xml">
]>
7
<chapter id="install-harfbuzz">
8 9
  <title>Installing HarfBuzz</title>
  
10
  <section id="download">
11
    <title id="download.title">Downloading HarfBuzz</title>
12
    <para>
13 14 15 16 17 18
      The HarfBuzz source code is hosted at <ulink
      url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz</ulink>. The
      same source tree is also available at the
      <ulink
	  url="http://cgit.freedesktop.org/harfbuzz/">Freedesktop.org</ulink>
      site.
19 20
    </para>
    <para>
21 22 23 24 25 26
      Tarball releases and Win32 binary bundles (which include the
      libharfbuzz DLL, hb-view.exe, hb-shape.exe, and all
      dependencies) of HarfBuzz can be downloaded from <ulink
      url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz/releases</ulink>
      or from 
      <ulink url="http://www.freedesktop.org/software/harfbuzz/release/">Freedesktop.org</ulink>.
27 28
    </para>
    <para>
29 30 31 32 33 34
      Release notes are posted with each new release to provide an
      overview of the changes. The project <ulink url="https://github.com/harfbuzz/harfbuzz/issues">tracks bug
      reports and other issues</ulink> on GitHub. Discussion and
      questions are welcome on the <ulink
      url="http://freedesktop.org/mailman/listinfo/harfbuzz/">HarfBuzz
      mailing list</ulink>.
35 36
    </para>
    <para>
37 38 39 40 41 42
      The API included in the <filename
      class='headerfile'>hb.h</filename> file will not change in a
      compatibility-breaking way in any release. However, other,
      peripheral headers are more likely to go through minor
      modifications. We will do our best to never change APIs in an
      incompatible way. We will <emphasis>never</emphasis> break the ABI. 
43 44
    </para>
  </section>
45
  
46
  <section id="building">
47 48 49 50
    <title>Building HarfBuzz</title>

    <section id="building.linux">
      <title>Building on Linux</title>
51
    <para>
52 53 54 55 56 57 58
      <emphasis>(1)</emphasis> To build HarfBuzz on Linux, you must first install the
      development packages for FreeType, Cairo, and GLib. The exact
      commands required for this step will vary depending on
      the Linux distribution you use.
    </para>
    <para>
      For example, on an Ubuntu or Debian system, you would run:
59
      <programlisting>
60 61
	<command>sudo apt install</command> <package>gcc g++
	libfreetype6-dev libglib2.0-dev libcairo2-dev</package>
62
      </programlisting>
63
      On Fedora, RHEL, CentOS, or other Red-Hat&ndash;based systems, you would run:
64
      <programlisting>
65
	<command>sudo yum install</command> <package>gcc gcc-c++ freetype-devel glib2-devel cairo-devel</package>
66
      </programlisting>
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

    </para>
    
    <para>
      <emphasis>(2)</emphasis> The next step depends on whether you
      are building from the source in a downloaded release tarball or
      from the source directly from the git repository.
    </para>
    <para>
      <emphasis>(2)(a)</emphasis> If you downloaded the HarfBuzz
      source code in a tarball, you can now extract the source.
    </para>
    <para>
      From a shell in the top-level directory of the extracted source
      code, you can run <command>./configure</command> followed by
      <command>make</command> as with any other standard package.
    </para>
    <para>
      This should leave you with a shared
      library in the <filename>src/</filename> directory, and a few
      utility programs including <command>hb-view</command> and
      <command>hb-shape</command> under the <filename>util/</filename>
      directory.
90 91
    </para>
    <para>
92 93 94 95 96
      <emphasis>(2)(b)</emphasis> If you are building from the source in the HarfBuzz git
      repository, rather than installing from a downloaded tarball
      release, then you must install two more auxiliary tools before you 
      can build for the first time: <package>pkg-config</package> and
      <ulink url="http://www.complang.org/ragel/">ragel</ulink>.
97 98
    </para>
    <para>
99
      On Ubuntu or Debian, run:
100
      <programlisting>
101
	<command>sudo apt-get install</command> <package>autoconf automake libtool pkg-config ragel gtk-doc-tools</package>
102
      </programlisting>
103
      On Fedora, RHEL, CentOS, run:
104
      <programlisting>
105
	<command>sudo yum install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
106
      </programlisting>
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
      
    </para>
    <para>
      With <package>pkg-config</package> and <package>ragel</package>
      installed, you can now run <command>./autogen.sh</command>,
      followed by <command>./configure</command> and
      <command>make</command> to build HarfBuzz.
    </para>
    </section>

    
    <section id="building.windows">
      <title>Building on Windows</title>

      <para>
	On Windows, consider using Microsoft's free <ulink
	url="https://github.com/Microsoft/vcpkg">vcpkg</ulink> utility
	to build HarfBuzz, its dependencies, and other open-source
	libraries. 
      </para>
      <para>
	If you need to build HarfBuzz from source, first put the
	<program>ragel</program> binary on your
	<literal>PATH</literal>, then follow the appveyor CI cmake
	<ulink
	    url="https://github.com/harfbuzz/harfbuzz/blob/master/appveyor.yml">build
	instructions</ulink>. 
      </para>
    </section>

    
    <section id="building.macos">
      <title>Building on macOS</title>

      <para>
	There are two ways to build HarfBuzz on Mac systems: MacPorts
	and Homebrew. The process is similar to the process used on a
	Linux system.
      </para>
      <para>
	<emphasis>(1)</emphasis> You must first install the
	development packages for FreeType, Cairo, and GLib. If you are
	using MacPorts, you should run:
150
      <programlisting>
151
	<command>sudo port install</command> <package>freetype glib2 cairo</package>
152
      </programlisting>
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
      </para>
      <para>
	If you are using Homebrew, you should run:
	<programlisting>	
	  <command>brew install</command> <package>freetype glib cairo</package>
	</programlisting>
      </para>
      <para>
	<emphasis>(2)</emphasis> The next step depends on whether you are building from the
	source in a downloaded release tarball or from the source directly
	from the git repository.
      </para>
      <para>
	<emphasis>(2)(a)</emphasis> If you are installing HarfBuzz
	from a downloaded tarball release, extract the tarball and
	open a Terminal in the extracted source-code directory. Run:
	<programlisting>
	  <command>./configure</command>
	</programlisting>
	followed by:
	<programlisting>	
	  <command>make</command>
	</programlisting>
	to build HarfBuzz.
      </para>
      <para>
	<emphasis>(2)(b)</emphasis> Alternatively, if you are building
	HarfBuzz from the source in the HarfBuzz git repository, then
	you must install several built-time dependencies before
	proceeding.
      </para>
      <para>If you are
	using MacPorts, you should run:
      <programlisting>
	<command>sudo port install</command> <package>autoconf
	automake libtool pkgconfig ragel gtk-doc</package> 
      </programlisting>
      to install the build dependencies.
      </para>
      <para>If you are using Homebrew, you should run:
	<programlisting>	
	  <command>brew install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
	</programlisting>
      	Finally, you can run:
	<programlisting>
	  <command>./autogen.sh</command>
	</programlisting>
      </para>
      <para>
	<emphasis>(3)</emphasis> You can now build HarfBuzz (on either
	a MacPorts or a Homebrew system) by running:
	<programlisting>
	  <command>./configure</command>
	</programlisting>
	followed by:
	<programlisting>
	  <command>make</command>
	</programlisting>
      </para>
      <para>
	This should leave you with a shared
	library in the <filename>src/</filename> directory, and a few
	utility programs including <command>hb-view</command> and
	<command>hb-shape</command> under the <filename>util/</filename>
	directory.
      </para>      
	
    </section>

222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
    <section id="configuration">
      <title>Configuration options</title>

      <para>
	The instructions in the "Building HarfBuzz" section will build
	the source code under its default configuration. If needed,
	the following additional configuration options are available.
      </para>

      <variablelist>
	<varlistentry>
	  <term>--with-libstdc++</term>
	  <listitem>
	    <para>
	      Allow linking with libstdc++. <emphasis>(Default = no)</emphasis>
	    </para>
238 239 240 241
	    <para>
	      This option enables or disables linking HarfBuzz to the
	      system's libstdc++ library.
	    </para>
242 243 244 245 246 247 248
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-glib</term>
	  <listitem>
	    <para>
249
	     Use <ulink url="https://developer.gnome.org/glib/">GLib</ulink>. <emphasis>(Default = auto)</emphasis>
250
	    </para>	    
251 252 253 254 255 256 257
	    <para>
	      This option enables or disables usage of the GLib
	      library.  The default setting is to check for the
	      presence of GLib and, if it is found, build with
	      GLib support. GLib is native to GNU/Linux systems but is
	      available on other operating system as well.
	    </para>
258 259 260 261 262 263 264
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-gobject</term>
	  <listitem>
	    <para>
265 266 267 268 269 270 271 272 273
	      Use <ulink url="https://developer.gnome.org/gobject/stable/">GObject</ulink>. <emphasis>(Default = no)</emphasis>
	    </para>	   
	    <para>
	      This option enables or disables usage of the GObject
	      library. The default setting is to check for the
	      presence of GObject and, if it is found, build with
	      GObject support. GObject is native to GNU/Linux systems but is
	      available on other operating system as well.
	    </para> 
274 275 276 277 278 279 280
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-cairo</term>
	  <listitem>
	    <para>
281 282 283 284 285 286 287
	      Use <ulink url="https://cairographics.org/">Cairo</ulink>. <emphasis>(Default = auto)</emphasis>
	    </para>	   
	    <para>
	      This option enables or disables usage of the Cairo
	      graphics-rendering library. The default setting is to
	      check for the presence of Cairo and, if it is found,
	      build with Cairo support.
N
Nathan Willis 已提交
288 289 290 291 292
	    </para>
	    <para>
	      Note: Cairo is used only by the HarfBuzz
	      command-line utilities, and not by the HarfBuzz library.
	    </para>
293 294 295 296 297 298 299
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-fontconfig</term>
	  <listitem>
	    <para>
300
	      Use <ulink url="https://www.freedesktop.org/wiki/Software/fontconfig/">Fontconfig</ulink>. <emphasis>(Default = auto)</emphasis>
301
	    </para>	    
302 303 304 305 306 307 308
	    <para>
	      This option enables or disables usage of the Fontconfig
	      library, which provides font-matching functions and
	      provides access to font properties. The default setting
	      is to check for the presence of Fontconfig and, if it is
	      found, build with Fontconfig support.
	    </para>
N
Nathan Willis 已提交
309 310 311 312
	    <para>
	      Note: Fontconfig is used only by the HarfBuzz
	      command-line utilities, and not by the HarfBuzz library.
	    </para>
313 314 315 316 317 318 319
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-icu</term>
	  <listitem>
	    <para>
320
	      Use the <ulink url="http://site.icu-project.org/home">ICU</ulink> library. <emphasis>(Default = auto)</emphasis>
321
	    </para>	    
322 323 324 325 326 327 328 329 330
	    <para>
	      This option enables or disables usage of the
	      <emphasis>International Components for
	      Unicode</emphasis> (ICU) library, which provides access
	      to Unicode Character Database (UCD) properties as well
	      as normalization and conversion functions. The default
	      setting is to check for the presence of ICU and, if it
	      is found, build with ICU support.
	    </para>
331 332 333 334 335 336 337
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-ucdn</term>
	  <listitem>
	    <para>
338
	      Use HarfBuzz's <ulink url="https://github.com/harfbuzz/harfbuzz/tree/master/src/hb-ucdn">built-in UCDN library</ulink>. <emphasis>(Default = auto)</emphasis>
339
	    </para>	    
340 341 342 343 344 345 346 347 348
	    <para>
	      The HarfBuzz source tree includes a <emphasis>Unicode
	      Database and Normalization</emphasis> (UCDN) library
	      that provides access to basic character properties in
	      the Unicode Character Database (UCD) as well as low-level
	      normalization functions. HarfBuzz can be built without
	      this UCDN support if the usage of a different UCDN
	      library is desired.
	    </para>
349 350 351 352 353 354 355
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-graphite2</term>
	  <listitem>
	    <para>
356
	      Use the <ulink url="http://graphite.sil.org/">Graphite2</ulink> library. <emphasis>(Default = no)</emphasis>
357
	    </para>	    
358 359 360 361 362
	    <para>
	      This option enables or disables usage of the Graphite2
	      library, which provides support for the Graphite shaping
	      model. 
	    </para>
363 364 365 366 367 368 369
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-freetype</term>
	  <listitem>
	    <para>
370
	      Use the <ulink url="https://www.freetype.org/">FreeType</ulink> library. <emphasis>(Default = auto)</emphasis>
371
	    </para>	    
372 373 374 375 376 377
	    <para>
	      This option enables or disables usage of the FreeType
	      font-rendering library. The default setting is to check for the
	      presence of FreeType and, if it is found, build with
	      FreeType support.
	    </para>
378 379 380 381 382 383 384
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-uniscribe</term>
	  <listitem>
	    <para>
385 386 387
	      Use the <ulink
	      url="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe">Uniscribe</ulink>
	      library (experimental). <emphasis>(Default = no)</emphasis>
388
	    </para>	    
389 390
	    <para>
	      This option enables or disables usage of the Uniscribe
391 392 393 394
	      font-rendering library. Uniscribe is available on
	      Windows systems. Uniscribe support is used only for
	      testing purposes and does not need to be enabled for
	      HarfBuzz to run on Windows systems.
395
	    </para>
396 397 398 399 400 401 402
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-directwrite</term>
	  <listitem>
	    <para>
403
	      Use the <ulink url="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal">DirectWrite</ulink> library (experimental). <emphasis>(Default = no)</emphasis>
404
	    </para>	    
405 406
	    <para>
	      This option enables or disables usage of the DirectWrite
407 408 409 410
	      font-rendering library. DirectWrite is available on
	      Windows systems. DirectWrite support is used only for
	      testing purposes and does not need to be enabled for
	      HarfBuzz to run on Windows systems.
411
	    </para>
412 413 414 415 416 417 418
	  </listitem>
	</varlistentry>
	
	<varlistentry>
	  <term>--with-coretext</term>
	  <listitem>
	    <para>
419
	      Use the <ulink url="https://developer.apple.com/documentation/coretext">CoreText</ulink> library. <emphasis>(Default = no)</emphasis>
420 421
	    </para>	    
	    <para>
422 423 424
	      This option enables or disables usage of the CoreText
	      library. CoreText is available on macOS and iOS systems.
	    </para>
425
	  </listitem>
426
	</varlistentry>	
427 428
      </variablelist>
    </section>
429
    
430 431
  </section>
</chapter>