HarfBuzz

HarfBuzz is an OpenType text shaping engine. There are two HarfBuzz code trees in existence today:

  • The current HarfBuzz tree, also known as harfbuzz-ng, is under active development and is what is used in latest versions of Firefox, GNOME, ChromeOS, Chrome Linux, LibreOffice, XeTeX, and Android among other places. The canonical source tree is available here. Also available on github. See below for release tarballs.

  • The old HarfBuzz tree, derived from FreeType, Pango, and Qt, is available here. It is not actively developed or maintained, and is extremely buggy. All users are encouraged to switch over to the new HarfBuzz as soon as possible. There are no release tarballs of old HarfBuzz whatsoever.

Download

For tarball releases of the new HarfBuzz codebase, look here. At the same place you will also find Win32 binary bundles that include libharfbuzz DLL, hb-view.exe, hb-shape.exe, and all dependencies.

The canonical source tree is available here. Also available on github.

The API is not expected to change incompatibly, but we cannot guarantee that until HarfBuzz 1.0.0 is released. Other than that, we consider it very stable, and the API that comes with hb.h is unlikely to change. API in hb-ft.h and other peripheral headers are more likely to through reviews before 1.0.

If you are not sure whether Pango or HarfBuzz is right for you, read this.

Building

On Linux, install the development packages for FreeType, Cairo, and GLib. For example, on Ubuntu / Debian, you would do:

  • sudo apt-get install gcc g++ libfreetype6-dev libglib2.0-dev libcairo2-dev

whereas on Fedora, RHEL, CentOS, and other Red Hat based systems you would do:

  • sudo yum install gcc gcc-c++ freetype-devel glib2-devel cairo-devel

or using MacPorts:

  • sudo port install freetype glib2 cairo

If you are using a tarball, you can now proceed to running configure and make as with any other standard package. That should leave you with a shared library in src/, and a few utility programs including hb-view and hb-shape under util/.

If you are bootstraping from git, you need a few more tools before you can run autogen.sh for the first time. Namely, pkg-config and ragel. Again, on Ubuntu / Debian:

  • sudo apt-get install autoconf automake libtool pkg-config ragel gtk-doc-tools

and on Fedora, RHEL, CentOS:

  • sudo yum install autoconf automake libtool pkgconfig ragel gtk-doc

or using MacPorts:

  • sudo port install autoconf automake libtool pkgconfig ragel gtk-doc

Development

To get a better idea of where HarfBuzz stands in the text rendering stack you may want to read State of Text Rendering.

Both development and user support discussion around HarfBuzz happens on the harfbuzz at lists freedesktop org mailing list. Some of the developers frequent the #harfbuzz channel on freenode IRC server. If you write to the mailing list, you are guaranteed to get an answer. The same is not necessarily true about the IRC channel, or if you write to individual developers. Feel free to write to the list to tell us how you are using HarfBuzz, or how well it has been suiting your project's needs.

To report bugs or submit patches, you can either use bugzilla, or the mailing list. Bugzilla is preferred, since we can track the issue until it has been fixed.

For a comparison of old vs new HarfBuzz memory consumption see this.

See past and upcoming HarfBuzz Hackfests

You can monitor various aspects of the project using the following online services:

  • The code is replicated on GitHub; pull requests are responded to,
  • With each commit, all tests are run on Travis CI,
  • Public API / ABI changes are tracked across releases on Upstream Tracker,
  • Extensive testing dashboard run by Jonathan Kew here,

ICU LayoutEngine

If your application uses ICU LayoutEngine library, there is a replacement library called icu-le-hb here that uses HarfBuzz to provide the ICU ?LayoutEngine API. The C++ API is not ABI compatible, but the C API is. This library has not been tested seriously. If you use it, please report your experience to the mailing list.

If you use ICU ParagraphLayout (aka layoutex, aka libiculx), you need to build that against icu-le-hb. See here for instructions.