With this change, harfbuzz can be consumed as a subproject without
making any changes to the build files of a project. All you need to do
is provide a wrap file with a `[provide]` section:
https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section
This is also necessary because otherwise projects need to hard-code
the subproject name, which might be `harfbuzz` when using `wrap-git` or
`harfbuzz-6.0.0` when using `wrap-file` (to build from a release
tarball). This can cause conflicts between different subprojects that
consume harfbuzz differently.
Other projects like glib, cairo, pango, etc already do this.
This reverts commit a335458d57.
While this can be vastly trimmed down, what I did is not right.
It still depends on hb-face, hb-font, hb-blob, hb-set, and hb-map.
This header has defines for all the optional
dependendencies that come with their own Harfbuzz
headers, so you can do:
#include <hb-features.h>
#ifdef HB_HAS_DIRECTWRITE
#include <hb-directwrite.h>
#endif
The previous code concatenates includedir to _harfbuzz_prefix verbatim,
which results in a wrong final include path in case includedir is an absolute
path. Instead, we can let meson determine the absolute include and lib paths
in advance and save them in the cmake config.
This is an issue in nixpkgs, where includedir is set to the final (absolute)
path of the built library in the Nix store, which causes CMake projects
depending on harfbuzz to not configure.
See https://github.com/NixOS/nixpkgs/issues/180054.
Support legacy pre-OpenType Windows 3.1-era fonts, by remapping PUA code
points in cmap table and letting our fallback shaper build the GSUB
table.
Uniscribe applies also mset-like substitution, but our fallback mark
positioning gives better results, so this is not implemented.
When harfbuzz is a subproject paths are in the form
"subprojects/harfbuzz/src/...". Instead of removing "src/" prefix, take
the absolute path and make it relative to current source dir.
This fix regression introduced in
https://github.com/harfbuzz/harfbuzz/pull/3394.