ronnie
2022-10-23 68f5ca84d926736535296469a2d3fcbea06ca8a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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
150
151
152
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<?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">
]>
<chapter id="install-harfbuzz">
  <title>Installing HarfBuzz</title>
  
  <section id="download">
    <title id="download.title">Downloading HarfBuzz</title>
    <para>
      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.
    </para>
    <para>
      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>.
    </para>
    <para>
      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>.
    </para>
    <para>
      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. 
    </para>
  </section>
  
  <section id="building">
    <title>Building HarfBuzz</title>
 
    <section id="building.linux">
      <title>Building on Linux</title>
    <para>
      <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:
      <programlisting>
   <command>sudo apt install</command> <package>gcc g++
   libfreetype6-dev libglib2.0-dev libcairo2-dev</package>
      </programlisting>
      On Fedora, RHEL, CentOS, or other Red-Hat&ndash;based systems, you would run:
      <programlisting>
   <command>sudo yum install</command> <package>gcc gcc-c++ freetype-devel glib2-devel cairo-devel</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 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.
    </para>
    <para>
      <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>.
    </para>
    <para>
      On Ubuntu or Debian, run:
      <programlisting>
   <command>sudo apt-get install</command> <package>autoconf automake libtool pkg-config ragel gtk-doc-tools</package>
      </programlisting>
      On Fedora, RHEL, CentOS, run:
      <programlisting>
   <command>sudo yum install</command> <package>autoconf automake libtool pkgconfig ragel gtk-doc</package>
      </programlisting>
      
    </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:
      <programlisting>
   <command>sudo port install</command> <package>freetype glib2 cairo</package>
      </programlisting>
      </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>
 
    <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>
       <para>
         This option enables or disables linking HarfBuzz to the
         system's libstdc++ library.
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-glib</term>
     <listitem>
       <para>
        Use <ulink url="https://developer.gnome.org/glib/">GLib</ulink>. <emphasis>(Default = auto)</emphasis>
       </para>        
       <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>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-gobject</term>
     <listitem>
       <para>
         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> 
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-cairo</term>
     <listitem>
       <para>
         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.
       </para>
       <para>
         Note: Cairo is used only by the HarfBuzz
         command-line utilities, and not by the HarfBuzz library.
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-fontconfig</term>
     <listitem>
       <para>
         Use <ulink url="https://www.freedesktop.org/wiki/Software/fontconfig/">Fontconfig</ulink>. <emphasis>(Default = auto)</emphasis>
       </para>        
       <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>
       <para>
         Note: Fontconfig is used only by the HarfBuzz
         command-line utilities, and not by the HarfBuzz library.
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-icu</term>
     <listitem>
       <para>
         Use the <ulink url="http://site.icu-project.org/home">ICU</ulink> library. <emphasis>(Default = auto)</emphasis>
       </para>        
       <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>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-ucdn</term>
     <listitem>
       <para>
         Use HarfBuzz's <ulink url="https://github.com/harfbuzz/harfbuzz/tree/master/src/hb-ucdn">built-in UCDN library</ulink>. <emphasis>(Default = auto)</emphasis>
       </para>        
       <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>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-graphite2</term>
     <listitem>
       <para>
         Use the <ulink url="http://graphite.sil.org/">Graphite2</ulink> library. <emphasis>(Default = no)</emphasis>
       </para>        
       <para>
         This option enables or disables usage of the Graphite2
         library, which provides support for the Graphite shaping
         model. 
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-freetype</term>
     <listitem>
       <para>
         Use the <ulink url="https://www.freetype.org/">FreeType</ulink> library. <emphasis>(Default = auto)</emphasis>
       </para>        
       <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>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-uniscribe</term>
     <listitem>
       <para>
         Use the <ulink
         url="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe">Uniscribe</ulink>
         library (experimental). <emphasis>(Default = no)</emphasis>
       </para>        
       <para>
         This option enables or disables usage of the Uniscribe
         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.
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-directwrite</term>
     <listitem>
       <para>
         Use the <ulink url="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal">DirectWrite</ulink> library (experimental). <emphasis>(Default = no)</emphasis>
       </para>        
       <para>
         This option enables or disables usage of the DirectWrite
         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.
       </para>
     </listitem>
   </varlistentry>
   
   <varlistentry>
     <term>--with-coretext</term>
     <listitem>
       <para>
         Use the <ulink url="https://developer.apple.com/documentation/coretext">CoreText</ulink> library. <emphasis>(Default = no)</emphasis>
       </para>        
       <para>
         This option enables or disables usage of the CoreText
         library. CoreText is available on macOS and iOS systems.
       </para>
     </listitem>
   </varlistentry>    
      </variablelist>
    </section>
    
  </section>
</chapter>