From cd33ff25ad06877df3823e1a9ab5e9d3b41a4e58 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 24 Nov 2022 14:35:26 +0100 Subject: Update the yeslogic-fontconfig-sys crate to 4.0.1 ... and adapt tests/src/utils.rs for changed fontconfig_sys import paths. Part-of: --- Cargo.lock | 25 +++++++++++++++++++++++-- Cargo.toml | 2 +- tests/src/utils.rs | 13 +++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 716806d0..8e0b699a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -520,6 +520,15 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -993,6 +1002,16 @@ version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "librsvg" version = "2.55.0" @@ -2668,10 +2687,12 @@ dependencies = [ [[package]] name = "yeslogic-fontconfig-sys" -version = "2.11.2" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e47154248a2dba5ca6965e26b1a59146210736ea9b862362b6d72682e57f8d" +checksum = "ec657fd32bbcbeaef5c7bc8e10b3db95b143fab8db0a50079773dbf936fd4f73" dependencies = [ "const-cstr", + "dlib", + "once_cell", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 9f209cb3..6c2bbc4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tempfile = "3" test-generator = "0.3" -yeslogic-fontconfig-sys = "2.11.1" +yeslogic-fontconfig-sys = "4.0.1" [build-dependencies] regex = "1.3.9" diff --git a/tests/src/utils.rs b/tests/src/utils.rs index f01d1c00..2eb5181a 100644 --- a/tests/src/utils.rs +++ b/tests/src/utils.rs @@ -49,7 +49,6 @@ pub fn render_document( #[cfg(system_deps_have_pangoft2)] mod pango_ft2 { use super::*; - use fontconfig_sys::fontconfig; use glib::prelude::*; use pangocairo::FontMap; @@ -59,7 +58,7 @@ mod pango_ft2 { // This is not bound in gtk-rs, and PangoFcFontMap is not even exposed, so we'll bind it by hand. fn pango_fc_font_map_set_config( font_map: *mut libc::c_void, - config: *mut fontconfig::FcConfig, + config: *mut fontconfig_sys::FcConfig, ); } @@ -73,15 +72,17 @@ mod pango_ft2 { "tests/resources/Roboto-BoldItalic.ttf", ]; - let config = fontconfig::FcConfigCreate(); - if fontconfig::FcConfigSetCurrent(config) == 0 { + let config = fontconfig_sys::FcConfigCreate(); + if fontconfig_sys::FcConfigSetCurrent(config) == 0 { panic!("Could not set a fontconfig configuration"); } for path in &font_paths { let path_cstring = CString::new(*path).unwrap(); - if fontconfig::FcConfigAppFontAddFile(config, path_cstring.as_ptr() as *const _) == 0 { + if fontconfig_sys::FcConfigAppFontAddFile(config, path_cstring.as_ptr() as *const _) + == 0 + { panic!("Could not load font file {} for tests; aborting", path,); } } @@ -90,7 +91,7 @@ mod pango_ft2 { let raw_font_map: *mut pango::ffi::PangoFontMap = font_map.to_glib_none().0; pango_fc_font_map_set_config(raw_font_map as *mut _, config); - fontconfig::FcConfigDestroy(config); + fontconfig_sys::FcConfigDestroy(config); FontMap::set_default(Some(&font_map.downcast::().unwrap())); } -- cgit v1.2.1