diff --git a/harfbuzz-sys/Cargo.toml b/harfbuzz-sys/Cargo.toml index fa886f67..780b77d0 100644 --- a/harfbuzz-sys/Cargo.toml +++ b/harfbuzz-sys/Cargo.toml @@ -27,9 +27,8 @@ pkg-config = { version = "0.3" } cc = { version = "1" } [target.'cfg(target_vendor = "apple")'.dependencies] -core-graphics = { version = "0.23", optional = true } -core-text = { version = "20", optional = true } -foreign-types = { version = "0.5", optional = true } +objc2-core-graphics = { version = "0.3.2", default-features = false, features = ["CGFont"], optional = true } +objc2-core-text = { version = "0.3.2", default-features = false, features = ["CTFont"], optional = true } [target.'cfg(target_family = "windows")'.dependencies.windows] version = "0.59" @@ -43,6 +42,6 @@ optional = true [features] default = ["coretext", "directwrite", "freetype"] bundled = [] -coretext = ["dep:core-graphics", "dep:core-text", "dep:foreign-types"] +coretext = ["dep:objc2-core-graphics", "dep:objc2-core-text"] directwrite = ["dep:windows"] freetype = ["dep:freetype-sys"] diff --git a/harfbuzz-sys/src/coretext.rs b/harfbuzz-sys/src/coretext.rs index cc847bd3..feed229a 100644 --- a/harfbuzz-sys/src/coretext.rs +++ b/harfbuzz-sys/src/coretext.rs @@ -9,19 +9,16 @@ use crate::{hb_face_t, hb_font_t}; -use core_graphics::font::CGFont; -use core_text::font::CTFontRef; -use foreign_types::ForeignType; - -type CGFontRef = *mut ::CType; +use objc2_core_graphics::CGFont; +use objc2_core_text::CTFont; extern "C" { /// This requires that the `coretext` feature is enabled. - pub fn hb_coretext_face_create(cg_font: CGFontRef) -> *mut hb_face_t; + pub fn hb_coretext_face_create(cg_font: CGFont) -> *mut hb_face_t; /// This requires that the `coretext` feature is enabled. - pub fn hb_coretext_font_create(ct_font: CTFontRef) -> *mut hb_font_t; + pub fn hb_coretext_font_create(ct_font: CTFont) -> *mut hb_font_t; /// This requires that the `coretext` feature is enabled. - pub fn hb_coretext_face_get_cg_font(face: *mut hb_face_t) -> CGFontRef; + pub fn hb_coretext_face_get_cg_font(face: *mut hb_face_t) -> CGFont; /// This requires that the `coretext` feature is enabled. - pub fn hb_coretext_font_get_ct_font(font: *mut hb_font_t) -> CTFontRef; + pub fn hb_coretext_font_get_ct_font(font: *mut hb_font_t) -> CTFont; }