Open defpis opened 3 years ago
Thanks for reporting the issue @defpis , do you have harfbuzz installed on your machine ?
if not do a brew install harfbuzz
and try again.
First, use pkg-config
to check whether harfbuzz is installed.
pkg-config --cflags harfbuzz
If you are using homebrew, then sometimes it's unaware of broken symlinks for dependencies that harfbuzz used.
brew unlink dep-name && brew link dep-name
As far as I know, the harfbuzz's Rust bindings is compiled without FreeType integration APIs. That's to say, you have to setup local patch for harbuzz-sys
manually.
provok Cargo.toml
:
diff --git a/Cargo.toml b/Cargo.toml
index a3ba62b..185b327 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,3 +23,6 @@ serde = {version = "1.0.126", features = ["derive"]}
serde_json = "1.0.64"
thiserror = "1.0"
ttf-parser = "0.12.0"
+
+[patch.crates-io]
+harfbuzz-sys = { path = "../rust-harfbuzz/harfbuzz-sys" }
Local harfbuzz-sys:
diff --git a/harfbuzz-sys/makefile.cargo b/harfbuzz-sys/makefile.cargo
index d0ec7a8..45c5ba2 100644
--- a/harfbuzz-sys/makefile.cargo
+++ b/harfbuzz-sys/makefile.cargo
@@ -32,7 +32,7 @@ CONFIGURE_FLAGS = \
--enable-static \
--disable-shared \
--without-icu \
- --without-freetype \
+ --without-freetype=auto \
--without-glib \
--with-coretext=auto
diff --git a/harfbuzz-sys/wrapper.h b/harfbuzz-sys/wrapper.h
index d2cfc6e..bfbc21c 100644
--- a/harfbuzz-sys/wrapper.h
+++ b/harfbuzz-sys/wrapper.h
@@ -1,3 +1,4 @@
#include "harfbuzz/src/hb.h"
+#include "harfbuzz/src/hb-ft.h"
#include "harfbuzz/src/hb-ot.h"
#include "harfbuzz/src/hb-aat.h"
Re-generate src/bindings.rs
via update.sh
. BTW, you could skip downloading.
when I run
make install
occur error:system_profiler: