usermanual-install-harfbuzz.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <?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. ]>
  7. <chapter id="install-harfbuzz">
  8. <title>Installing HarfBuzz</title>
  9. <section id="download">
  10. <title id="download.title">Downloading HarfBuzz</title>
  11. <para>
  12. The HarfBuzz source code is hosted at <ulink
  13. url="https://github.com/harfbuzz/harfbuzz">github.com/harfbuzz/harfbuzz</ulink>.
  14. </para>
  15. <para>
  16. Tarball releases and Win32 binary bundles (which include the
  17. libharfbuzz DLL, hb-view.exe, hb-shape.exe, and all
  18. dependencies) of HarfBuzz can be downloaded from <ulink
  19. url="https://github.com/harfbuzz/harfbuzz/releases">github.com/harfbuzz/harfbuzz/releases</ulink>.
  20. </para>
  21. <para>
  22. Release notes are posted with each new release to provide an
  23. overview of the changes. The project <ulink url="https://github.com/harfbuzz/harfbuzz/issues">tracks bug
  24. reports and other issues</ulink> on GitHub. Discussion and
  25. questions are welcome on <ulink
  26. url="https://github.com/harfbuzz/harfbuzz/discussions">GitHub</ulink> as well.
  27. </para>
  28. <para>
  29. The API included in the <filename
  30. class='headerfile'>hb.h</filename> file will not change in a
  31. compatibility-breaking way in any release. However, other,
  32. peripheral headers are more likely to go through minor
  33. modifications. We will do our best to never change APIs in an
  34. incompatible way. We will <emphasis>never</emphasis> break the ABI.
  35. </para>
  36. </section>
  37. <section id="building">
  38. <title>Building HarfBuzz</title>
  39. <section id="building.linux">
  40. <title>Building on Linux</title>
  41. <para>
  42. <emphasis>(1)</emphasis> To build HarfBuzz on Linux, you must first install the
  43. development packages for FreeType, Cairo, and GLib. The exact
  44. commands required for this step will vary depending on
  45. the Linux distribution you use.
  46. </para>
  47. <para>
  48. For example, on an Ubuntu or Debian system, you would run:
  49. <programlisting><command>sudo apt install</command> <package>gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev</package></programlisting>
  50. On Fedora, RHEL, CentOS, or other Red-Hat&ndash;based systems, you would run:
  51. <programlisting><command>sudo yum install</command> <package>gcc gcc-c++ freetype-devel glib2-devel cairo-devel</package></programlisting>
  52. </para>
  53. <para>
  54. <emphasis>(2)</emphasis> The next step depends on whether you
  55. are building from the source in a downloaded release tarball or
  56. from the source directly from the git repository.
  57. </para>
  58. <para>
  59. <emphasis>(2)(a)</emphasis> If you downloaded the HarfBuzz
  60. source code in a tarball, you can now extract the source.
  61. </para>
  62. <para>
  63. From a shell in the top-level directory of the extracted source
  64. code, you can run <command>meson build</command> followed by
  65. <command>meson compile -C build</command> as with any other standard package.
  66. </para>
  67. <para>
  68. This should leave you with a shared
  69. library in the <filename>src/</filename> directory, and a few
  70. utility programs including <command>hb-view</command> and
  71. <command>hb-shape</command> under the <filename>util/</filename>
  72. directory.
  73. </para>
  74. <para>
  75. <emphasis>(2)(b)</emphasis> If you are building from the source in the HarfBuzz git
  76. repository, rather than installing from a downloaded tarball
  77. release, then you must install two more auxiliary tools before you
  78. can build for the first time: <package>pkg-config</package>.
  79. </para>
  80. <para>
  81. On Ubuntu or Debian, run:
  82. <programlisting><command>sudo apt-get install</command> <package>meson pkg-config gtk-doc-tools</package></programlisting>
  83. On Fedora, RHEL, CentOS, run:
  84. <programlisting><command>sudo yum install</command> <package>meson pkgconfig gtk-doc</package></programlisting>
  85. </para>
  86. <para>
  87. With <package>pkg-config</package> installed, you can now run
  88. <command>meson build</command> then
  89. <command>meson compile -C build</command> to build HarfBuzz.
  90. </para>
  91. </section>
  92. <section id="building.windows">
  93. <title>Building on Windows</title>
  94. <para>
  95. <ulink url="https://mesonbuild.com/Getting-meson.html">Install meson</ulink>
  96. and run (from the console) <command>meson build</command> (by default
  97. bundled dependencies are not built, <command>--wrap-mode=default</command>
  98. overrides this), then <command>meson compile -C build</command> to
  99. build HarfBuzz.
  100. </para>
  101. </section>
  102. <section id="building.macos">
  103. <title>Building on macOS</title>
  104. <para>
  105. There are two ways to build HarfBuzz on Mac systems: MacPorts
  106. and Homebrew. The process is similar to the process used on a
  107. Linux system.
  108. </para>
  109. <para>
  110. <emphasis>(1)</emphasis> You must first install the
  111. development packages for FreeType, Cairo, and GLib. If you are
  112. using MacPorts, you should run:
  113. <programlisting><command>sudo port install</command> <package>freetype glib2 cairo</package></programlisting>
  114. </para>
  115. <para>
  116. If you are using Homebrew, you should run:
  117. <programlisting><command>brew install</command> <package>freetype glib cairo</package></programlisting>
  118. </para>
  119. <para>
  120. <emphasis>(2)</emphasis> The next step depends on whether you are building from the
  121. source in a downloaded release tarball or from the source directly
  122. from the git repository.
  123. </para>
  124. <para>
  125. <emphasis>(2)(a)</emphasis> If you are installing HarfBuzz
  126. from a downloaded tarball release, extract the tarball and
  127. open a Terminal in the extracted source-code directory. Run:
  128. <programlisting><command>meson build</command></programlisting>
  129. followed by:
  130. <programlisting><command>meson compile -C build</command></programlisting>
  131. to build HarfBuzz.
  132. </para>
  133. <para>
  134. <emphasis>(2)(b)</emphasis> Alternatively, if you are building
  135. HarfBuzz from the source in the HarfBuzz git repository, then
  136. you must install several built-time dependencies before
  137. proceeding.
  138. </para>
  139. <para>If you are
  140. using MacPorts, you should run:
  141. <programlisting><command>sudo port install</command> <package>meson pkgconfig gtk-doc</package></programlisting>
  142. to install the build dependencies.
  143. </para>
  144. <para>If you are using Homebrew, you should run:
  145. <programlisting><command>brew install</command> <package>meson pkgconfig gtk-doc</package></programlisting>
  146. Finally, you can run:
  147. <programlisting><command>meson build</command></programlisting>
  148. </para>
  149. <para>
  150. <emphasis>(3)</emphasis> You can now build HarfBuzz (on either
  151. a MacPorts or a Homebrew system) by running:
  152. <programlisting><command>meson build</command></programlisting>
  153. followed by:
  154. <programlisting><command>meson compile -C build</command></programlisting>
  155. </para>
  156. <para>
  157. This should leave you with a shared
  158. library in the <filename>src/</filename> directory, and a few
  159. utility programs including <command>hb-view</command> and
  160. <command>hb-shape</command> under the <filename>util/</filename>
  161. directory.
  162. </para>
  163. </section>
  164. <section id="configuration">
  165. <title>Configuration options</title>
  166. <para>
  167. The instructions in the "Building HarfBuzz" section will build
  168. the source code under its default configuration. If needed,
  169. the following additional configuration options are available.
  170. </para>
  171. <variablelist>
  172. <?dbfo list-presentation="blocks"?>
  173. <varlistentry>
  174. <term><command>-Dglib=enabled</command></term>
  175. <listitem>
  176. <para>
  177. Use <ulink url="https://developer.gnome.org/glib/">GLib</ulink>. <emphasis>(Default = auto)</emphasis>
  178. </para>
  179. <para>
  180. This option enables or disables usage of the GLib
  181. library. The default setting is to check for the
  182. presence of GLib and, if it is found, build with
  183. GLib support. GLib is native to GNU/Linux systems but is
  184. available on other operating system as well.
  185. </para>
  186. </listitem>
  187. </varlistentry>
  188. <varlistentry>
  189. <term><command>-Dgobject=enabled</command></term>
  190. <listitem>
  191. <para>
  192. Use <ulink url="https://developer.gnome.org/gobject/stable/">GObject</ulink>. <emphasis>(Default = no)</emphasis>
  193. </para>
  194. <para>
  195. This option enables or disables usage of the GObject
  196. library. The default setting is to check for the
  197. presence of GObject and, if it is found, build with
  198. GObject support. GObject is native to GNU/Linux systems but is
  199. available on other operating system as well.
  200. </para>
  201. </listitem>
  202. </varlistentry>
  203. <varlistentry>
  204. <term><command>-Dcairo=enabled</command></term>
  205. <listitem>
  206. <para>
  207. Use <ulink url="https://cairographics.org/">Cairo</ulink>. <emphasis>(Default = auto)</emphasis>
  208. </para>
  209. <para>
  210. This option enables or disables usage of the Cairo
  211. graphics-rendering library. The default setting is to
  212. check for the presence of Cairo and, if it is found,
  213. build with Cairo support.
  214. </para>
  215. <para>
  216. Note: Cairo is used only by the HarfBuzz
  217. command-line utilities, and not by the HarfBuzz library.
  218. </para>
  219. </listitem>
  220. </varlistentry>
  221. <varlistentry>
  222. <term><command>-Dicu=enabled</command></term>
  223. <listitem>
  224. <para>
  225. Use the <ulink url="http://site.icu-project.org/home">ICU</ulink> library. <emphasis>(Default = auto)</emphasis>
  226. </para>
  227. <para>
  228. This option enables or disables usage of the
  229. <emphasis>International Components for
  230. Unicode</emphasis> (ICU) library, which provides access
  231. to Unicode Character Database (UCD) properties as well
  232. as normalization and conversion functions. The default
  233. setting is to check for the presence of ICU and, if it
  234. is found, build with ICU support.
  235. </para>
  236. </listitem>
  237. </varlistentry>
  238. <varlistentry>
  239. <term><command>-Dgraphite=enabled</command></term>
  240. <listitem>
  241. <para>
  242. Use the <ulink url="http://graphite.sil.org/">Graphite2</ulink> library. <emphasis>(Default = no)</emphasis>
  243. </para>
  244. <para>
  245. This option enables or disables usage of the Graphite2
  246. library, which provides support for the Graphite shaping
  247. model.
  248. </para>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry>
  252. <term><command>-Dfreetype=enabled</command></term>
  253. <listitem>
  254. <para>
  255. Use the <ulink url="https://www.freetype.org/">FreeType</ulink> library. <emphasis>(Default = auto)</emphasis>
  256. </para>
  257. <para>
  258. This option enables or disables usage of the FreeType
  259. font-rendering library. The default setting is to check for the
  260. presence of FreeType and, if it is found, build with
  261. FreeType support.
  262. </para>
  263. </listitem>
  264. </varlistentry>
  265. <varlistentry>
  266. <term><command>-Dgdi=enabled</command></term>
  267. <listitem>
  268. <para>
  269. Use the <ulink
  270. url="https://docs.microsoft.com/en-us/windows/desktop/intl/uniscribe">Uniscribe</ulink>
  271. library (experimental). <emphasis>(Default = no)</emphasis>
  272. </para>
  273. <para>
  274. This option enables or disables usage of the Uniscribe
  275. font-rendering library. Uniscribe is available on
  276. Windows systems. Uniscribe support is used only for
  277. testing purposes and does not need to be enabled for
  278. HarfBuzz to run on Windows systems.
  279. </para>
  280. </listitem>
  281. </varlistentry>
  282. <varlistentry>
  283. <term><command>-Ddirectwrite=enabled</command></term>
  284. <listitem>
  285. <para>
  286. Use the <ulink url="https://docs.microsoft.com/en-us/windows/desktop/directwrite/direct-write-portal">DirectWrite</ulink> library (experimental). <emphasis>(Default = no)</emphasis>
  287. </para>
  288. <para>
  289. This option enables or disables usage of the DirectWrite
  290. font-rendering library. DirectWrite is available on
  291. Windows systems. DirectWrite support is used only for
  292. testing purposes and does not need to be enabled for
  293. HarfBuzz to run on Windows systems.
  294. </para>
  295. </listitem>
  296. </varlistentry>
  297. <varlistentry>
  298. <term><command>-Dcoretext=enabled</command></term>
  299. <listitem>
  300. <para>
  301. Use the <ulink url="https://developer.apple.com/documentation/coretext">CoreText</ulink> library. <emphasis>(Default = no)</emphasis>
  302. </para>
  303. <para>
  304. This option enables or disables usage of the CoreText
  305. library. CoreText is available on macOS and iOS systems.
  306. </para>
  307. </listitem>
  308. </varlistentry>
  309. <varlistentry>
  310. <term><command>-Ddocs=enabled</command></term>
  311. <listitem>
  312. <para>
  313. Use <ulink url="https://github.com/GNOME/gtk-doc">GTK-Doc</ulink>. <emphasis>(Default = no)</emphasis>
  314. </para>
  315. <para>
  316. This option enables the building of the documentation.
  317. </para>
  318. </listitem>
  319. </varlistentry>
  320. </variablelist>
  321. </section>
  322. </section>
  323. </chapter>