1 // Copyright 2013 The Servo Project Developers. See the COPYRIGHT 2 // file at the top-level directory of this distribution. 3 // 4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or 5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your 7 // option. This file may not be copied, modified, or distributed 8 // except according to those terms. 9 10 use core_foundation::array::{CFArray, CFArrayRef}; 11 use core_foundation::base::TCFType; 12 use core_foundation::string::CFString; 13 use core_foundation::url::CFURLRef; 14 copy_available_font_family_names() -> CFArray<CFString>15pub fn copy_available_font_family_names() -> CFArray<CFString> { 16 unsafe { 17 TCFType::wrap_under_create_rule(CTFontManagerCopyAvailableFontFamilyNames()) 18 } 19 } 20 21 extern { 22 /* 23 * CTFontManager.h 24 */ 25 26 // Incomplete function bindings are mostly related to CoreText font matching, which 27 // we implement in a platform-independent manner using FontMatcher. 28 29 //pub fn CTFontManagerCompareFontFamilyNames CTFontManagerCopyAvailableFontURLs() -> CFArrayRef30 pub fn CTFontManagerCopyAvailableFontURLs() -> CFArrayRef; CTFontManagerCopyAvailableFontFamilyNames() -> CFArrayRef31 pub fn CTFontManagerCopyAvailableFontFamilyNames() -> CFArrayRef; CTFontManagerCopyAvailablePostScriptNames() -> CFArrayRef32 pub fn CTFontManagerCopyAvailablePostScriptNames() -> CFArrayRef; CTFontManagerCreateFontDescriptorsFromURL(fileURL: CFURLRef) -> CFArrayRef33 pub fn CTFontManagerCreateFontDescriptorsFromURL(fileURL: CFURLRef) -> CFArrayRef; 34 //pub fn CTFontManagerCreateFontRequestRunLoopSource 35 //pub fn CTFontManagerEnableFontDescriptors 36 //pub fn CTFontManagerGetAutoActivationSetting 37 //pub fn CTFontManagerGetScopeForURL 38 //pub fn CTFontManagerGetAutoActivationSetting 39 //pub fn CTFontManagerGetScopeForURL CTFontManagerIsSupportedFont(fontURL: CFURLRef) -> bool40 pub fn CTFontManagerIsSupportedFont(fontURL: CFURLRef) -> bool; 41 //pub fn CTFontManagerRegisterFontsForURL 42 //pub fn CTFontManagerRegisterFontsForURLs 43 //pub fn CTFontManagerRegisterGraphicsFont 44 //pub fn CTFontManagerSetAutoActivationSetting 45 //pub fn CTFontManagerUnregisterFontsForURL 46 //pub fn CTFontManagerUnregisterFontsForURLs 47 //pub fn CTFontManagerUnregisterGraphicsFont 48 } 49