Introduction to Harfbuzz
The HarfBuzz package contains an
OpenType text shaping engine.
Note
Development versions of BLFS may not build or run some packages
properly if LFS or dependencies have been updated since the most
recent stable versions of the books.
Package Information
HarfBuzz Dependencies
Recommended
GLib-2.80.0 (required for Pango; GObject
Introspection required for building GNOME), Graphite2-1.3.14
(required for building texlive-20240312 or LibreOffice-24.2.3.2 with system
harfbuzz), ICU-75.1, and FreeType-2.13.2 (after harfbuzz is
installed, reinstall freetype)
Optional
Cairo-1.18.0 (circular: build cairo and all its
recommended dependencies, including harfbuzz, first, then rebuild
harfbuzz if the cairo backend is needed), git-2.45.0, GTK-Doc-1.34.0, FontTools
(Python 3 module, for the test suite), ragel, and wasm-micro-runtime
Warning
Recommended dependencies are not strictly required to build the
package. However, you might not get expected results at runtime
if you don't install them. Please do not report bugs with this
package if you have not
installed the recommended dependencies.
Installation of HarfBuzz
Install HarfBuzz by running the
following commands:
mkdir build &&
cd build &&
meson setup .. \
--prefix=/usr \
--buildtype=release \
-Dcpp_std=c++17 \
-Dgraphite2=enabled &&
ninja
To test the results, issue: ninja
test.
Now, as the root
user:
ninja install
Command Explanations
--buildtype=release
:
Specify a buildtype suitable for stable releases of the package, as
the default may produce unoptimized binaries.
-Dcpp_std=c++17
: This
switch ensures compiling the C++ code following the C++17 standard,
overriding the default of this package (C++11). It's required to
build this package with ICU-75.1 installed because some ICU headers use
C++17 features. It is unnecessary if ICU-75.1 is not installed, but does
no harm anyway.
-Dgraphite2=enabled
: This
switch enables Graphite2 support,
which is required for building texlive-20240312 or LibreOffice-24.2.3.2 with system harfbuzz.
-Ddocs=disabled
: If GTK-Doc-1.34.0 is
installed, the documentation is built and installed. This switch
prevents that.
Contents
Installed Programs:
hb-info, hb-ot-shape-closure, hb-shape,
hb-subset, and hb-view (only if Cairo is installed)
Installed Libraries:
libharfbuzz.so, libharfbuzz-cairo.so
(only if Cairo is installed), libharfbuzz-gobject.so,
libharfbuzz-icu.so, and libharfbuzz-subset.so
Installed Directories:
/usr/include/harbuzz,
/usr/lib/cmake/harfbuzz, and /usr/share/gtk-doc/html/harfbuzz
(optional)
Short Descriptions
hb-info
|
is used for gathering information about fonts installed
on the system
|
hb-ot-shape-closure
|
gives the set of characters contained in a string,
represented as single characters and/or single character
names. Example: hb-ot-shape-closure
/usr/share/fonts/dejavu/DejaVuSans.ttf "Hello
World."
|
hb-shape
|
is used for the conversion of text strings into
positioned glyphs
|
hb-subset
|
is used to create subsets of fonts, and display text
using them
|
hb-view
|
displays a graphical view of a string shape using a
particular font as a set of glyphs. The output format is
automatically defined by the file extension, the
supported ones being ansi/png/svg/pdf/ps/eps. For
example: hb-view
--output-file=hello.png
/usr/share/fonts/dejavu/DejaVuSans.ttf "Hello
World."
|
libharfbuzz.so
|
is the HarfBuzz text shaping library
|
libharfbuzz-cairo.so
|
provides Cairo integration for the Harfbuzz text shaping
library
|
libharfbuzz-gobject.so
|
provides GObject integration for the HarfBuzz text
shaping library
|
libharfbuzz-icu.so
|
provides ICU integration for the HarfBuzz text shaping
library
|
libharfbuzz-subset.so
|
provides API functions for performing subsetting
operations on font files
|