diff options
Diffstat (limited to 'font/src')
| -rw-r--r-- | font/src/ft/list_fonts.rs | 41 | ||||
| -rw-r--r-- | font/src/lib.rs | 2 |
2 files changed, 36 insertions, 7 deletions
diff --git a/font/src/ft/list_fonts.rs b/font/src/ft/list_fonts.rs index 5fa40ac8..7fdf6250 100644 --- a/font/src/ft/list_fonts.rs +++ b/font/src/ft/list_fonts.rs @@ -19,7 +19,7 @@ pub mod fc { use std::ops::Deref; use std::path::PathBuf; - use ffi_util::{ForeignType, ForeignTypeRef}; + use foreign_types::{ForeignType, ForeignTypeRef}; use libc::{c_char, c_int}; use fontconfig::fontconfig as ffi; @@ -47,11 +47,40 @@ pub mod fc { current: usize, } - ffi_type!(Pattern, PatternRef, FcPattern, FcPatternDestroy); - ffi_type!(Config, ConfigRef, FcConfig, FcConfigDestroy); - ffi_type!(ObjectSet, ObjectSetRef, FcObjectSet, FcObjectSetDestroy); - ffi_type!(FontSet, FontSetRef, FcFontSet, FcFontSetDestroy); - ffi_type!(CharSet, CharSetRef, FcCharSet, FcCharSetDestroy); + foreign_type! { + type CType = FcPattern; + fn drop = FcPatternDestroy; + pub struct Pattern; + pub struct PatternRef; + } + + foreign_type! { + type CType = FcConfig; + fn drop = FcConfigDestroy; + pub struct Config; + pub struct ConfigRef; + } + + foreign_type! { + type CType = FcObjectSet; + fn drop = FcObjectSetDestroy; + pub struct ObjectSet; + pub struct ObjectSetRef; + } + + foreign_type! { + type CType = FcFontSet; + fn drop = FcFontSetDestroy; + pub struct FontSet; + pub struct FontSetRef; + } + + foreign_type! { + type CType = FcCharSet; + fn drop = FcCharSetDestroy; + pub struct CharSet; + pub struct CharSetRef; + } impl ObjectSet { #[allow(dead_code)] diff --git a/font/src/lib.rs b/font/src/lib.rs index f04f00d8..4d63c7f3 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -36,7 +36,7 @@ extern crate libc; #[cfg(not(target_os = "macos"))] #[macro_use] -extern crate ffi_util; +extern crate foreign_types; #[macro_use] extern crate log; |