Skip to content

Commit

Permalink
freetype: Make optional, rename feature.
Browse files Browse the repository at this point in the history
Now, the feature for this is called `freetype` rather than
`build-native-freetype`. This was never building FreeType
but just saying to build with FreeType and to use `freetype-sys`.

The default features were disabled for `freetype` and then enabling
the `freetype-sys` feature, but that's exactly what the `freetype`
crate does by default, so simplify by not trying to do it again.

Partial fix for #184 (this doesn't handle the `coretext` side).
  • Loading branch information
waywardmonkeys committed Aug 19, 2023
1 parent 9b57880 commit 2f46adf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
7 changes: 1 addition & 6 deletions harfbuzz-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,10 @@ foreign-types = "0.3"
version = "0.3"
features = ["dwrite"]

[target.'cfg(any(target_os = "android", all(unix, not(target_vendor = "apple"))))'.dependencies]
freetype = { version = "0.7", default-features = false }

[dependencies.freetype]
version = "0.7"
default-features = false
optional = true

[features]
default = ["build-native-harfbuzz", "build-native-freetype"]
default = ["build-native-harfbuzz", "freetype"]
build-native-harfbuzz = ["cc", "pkg-config"]
build-native-freetype = ["freetype", "freetype/freetype-sys"]
6 changes: 1 addition & 5 deletions harfbuzz-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ pub mod coretext;
#[cfg(target_family = "windows")]
pub mod directwrite;

#[cfg(any(
target_os = "android",
all(unix, not(target_vendor = "apple")),
feature = "build-native-freetype"
))]
#[cfg(feature = "freetype")]
extern "C" {
pub fn hb_ft_font_create_referenced(face: freetype::freetype::FT_Face) -> *mut hb_font_t;
}
Expand Down
4 changes: 2 additions & 2 deletions harfbuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ version = "0.5.0"
default-features = false

[features]
default = ["build-native-harfbuzz", "build-native-freetype"]
default = ["build-native-harfbuzz", "freetype"]
build-native-harfbuzz = ["harfbuzz-sys/build-native-harfbuzz"]
build-native-freetype = ["harfbuzz-sys/build-native-freetype"]
freetype = ["harfbuzz-sys/freetype"]

0 comments on commit 2f46adf

Please sign in to comment.