objc2_core_graphics/generated/
CGFont.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgfont?language=objc)
14#[repr(C)]
15pub struct CGFont {
16    inner: [u8; 0],
17    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20cf_type!(
21    unsafe impl CGFont {}
22);
23#[cfg(feature = "objc2")]
24cf_objc2_type!(
25    unsafe impl RefEncode<"CGFont"> for CGFont {}
26);
27
28/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgfontindex?language=objc)
29pub type CGFontIndex = c_ushort;
30
31/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgglyph?language=objc)
32pub type CGGlyph = CGFontIndex;
33
34/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgfontpostscriptformat?language=objc)
35// NS_ENUM
36#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct CGFontPostScriptFormat(pub i32);
39impl CGFontPostScriptFormat {
40    #[doc(alias = "kCGFontPostScriptFormatType1")]
41    pub const Type1: Self = Self(1);
42    #[doc(alias = "kCGFontPostScriptFormatType3")]
43    pub const Type3: Self = Self(3);
44    #[doc(alias = "kCGFontPostScriptFormatType42")]
45    pub const Type42: Self = Self(42);
46}
47
48#[cfg(feature = "objc2")]
49unsafe impl Encode for CGFontPostScriptFormat {
50    const ENCODING: Encoding = i32::ENCODING;
51}
52
53#[cfg(feature = "objc2")]
54unsafe impl RefEncode for CGFontPostScriptFormat {
55    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontindexmax?language=objc)
59pub static kCGFontIndexMax: CGFontIndex = 65534;
60
61/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontindexinvalid?language=objc)
62pub static kCGFontIndexInvalid: CGFontIndex = 65535;
63
64/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgglyphmax?language=objc)
65pub static kCGGlyphMax: CGFontIndex = kCGFontIndexMax;
66
67unsafe impl ConcreteType for CGFont {
68    #[doc(alias = "CGFontGetTypeID")]
69    #[inline]
70    fn type_id() -> CFTypeID {
71        extern "C-unwind" {
72            fn CGFontGetTypeID() -> CFTypeID;
73        }
74        unsafe { CGFontGetTypeID() }
75    }
76}
77
78impl CGFont {
79    #[doc(alias = "CGFontCreateWithPlatformFont")]
80    #[deprecated = "No longer supported"]
81    #[inline]
82    pub unsafe fn with_platform_font(
83        platform_font_reference: *mut c_void,
84    ) -> Option<CFRetained<CGFont>> {
85        extern "C-unwind" {
86            fn CGFontCreateWithPlatformFont(
87                platform_font_reference: *mut c_void,
88            ) -> Option<NonNull<CGFont>>;
89        }
90        let ret = unsafe { CGFontCreateWithPlatformFont(platform_font_reference) };
91        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
92    }
93
94    #[doc(alias = "CGFontCreateWithDataProvider")]
95    #[cfg(feature = "CGDataProvider")]
96    #[inline]
97    pub unsafe fn with_data_provider(provider: &CGDataProvider) -> Option<CFRetained<CGFont>> {
98        extern "C-unwind" {
99            fn CGFontCreateWithDataProvider(provider: &CGDataProvider) -> Option<NonNull<CGFont>>;
100        }
101        let ret = unsafe { CGFontCreateWithDataProvider(provider) };
102        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
103    }
104
105    #[doc(alias = "CGFontCreateWithFontName")]
106    #[inline]
107    pub unsafe fn with_font_name(name: Option<&CFString>) -> Option<CFRetained<CGFont>> {
108        extern "C-unwind" {
109            fn CGFontCreateWithFontName(name: Option<&CFString>) -> Option<NonNull<CGFont>>;
110        }
111        let ret = unsafe { CGFontCreateWithFontName(name) };
112        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
113    }
114
115    #[doc(alias = "CGFontCreateCopyWithVariations")]
116    #[inline]
117    pub unsafe fn new_copy_with_variations(
118        font: Option<&CGFont>,
119        variations: Option<&CFDictionary>,
120    ) -> Option<CFRetained<CGFont>> {
121        extern "C-unwind" {
122            fn CGFontCreateCopyWithVariations(
123                font: Option<&CGFont>,
124                variations: Option<&CFDictionary>,
125            ) -> Option<NonNull<CGFont>>;
126        }
127        let ret = unsafe { CGFontCreateCopyWithVariations(font, variations) };
128        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
129    }
130
131    #[doc(alias = "CGFontGetNumberOfGlyphs")]
132    #[inline]
133    pub unsafe fn number_of_glyphs(font: Option<&CGFont>) -> usize {
134        extern "C-unwind" {
135            fn CGFontGetNumberOfGlyphs(font: Option<&CGFont>) -> usize;
136        }
137        unsafe { CGFontGetNumberOfGlyphs(font) }
138    }
139
140    #[doc(alias = "CGFontGetUnitsPerEm")]
141    #[inline]
142    pub unsafe fn units_per_em(font: Option<&CGFont>) -> c_int {
143        extern "C-unwind" {
144            fn CGFontGetUnitsPerEm(font: Option<&CGFont>) -> c_int;
145        }
146        unsafe { CGFontGetUnitsPerEm(font) }
147    }
148
149    #[doc(alias = "CGFontCopyPostScriptName")]
150    #[inline]
151    pub unsafe fn post_script_name(font: Option<&CGFont>) -> Option<CFRetained<CFString>> {
152        extern "C-unwind" {
153            fn CGFontCopyPostScriptName(font: Option<&CGFont>) -> Option<NonNull<CFString>>;
154        }
155        let ret = unsafe { CGFontCopyPostScriptName(font) };
156        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
157    }
158
159    #[doc(alias = "CGFontCopyFullName")]
160    #[inline]
161    pub unsafe fn full_name(font: Option<&CGFont>) -> Option<CFRetained<CFString>> {
162        extern "C-unwind" {
163            fn CGFontCopyFullName(font: Option<&CGFont>) -> Option<NonNull<CFString>>;
164        }
165        let ret = unsafe { CGFontCopyFullName(font) };
166        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
167    }
168
169    #[doc(alias = "CGFontGetAscent")]
170    #[inline]
171    pub unsafe fn ascent(font: Option<&CGFont>) -> c_int {
172        extern "C-unwind" {
173            fn CGFontGetAscent(font: Option<&CGFont>) -> c_int;
174        }
175        unsafe { CGFontGetAscent(font) }
176    }
177
178    #[doc(alias = "CGFontGetDescent")]
179    #[inline]
180    pub unsafe fn descent(font: Option<&CGFont>) -> c_int {
181        extern "C-unwind" {
182            fn CGFontGetDescent(font: Option<&CGFont>) -> c_int;
183        }
184        unsafe { CGFontGetDescent(font) }
185    }
186
187    #[doc(alias = "CGFontGetLeading")]
188    #[inline]
189    pub unsafe fn leading(font: Option<&CGFont>) -> c_int {
190        extern "C-unwind" {
191            fn CGFontGetLeading(font: Option<&CGFont>) -> c_int;
192        }
193        unsafe { CGFontGetLeading(font) }
194    }
195
196    #[doc(alias = "CGFontGetCapHeight")]
197    #[inline]
198    pub unsafe fn cap_height(font: Option<&CGFont>) -> c_int {
199        extern "C-unwind" {
200            fn CGFontGetCapHeight(font: Option<&CGFont>) -> c_int;
201        }
202        unsafe { CGFontGetCapHeight(font) }
203    }
204
205    #[doc(alias = "CGFontGetXHeight")]
206    #[inline]
207    pub unsafe fn x_height(font: Option<&CGFont>) -> c_int {
208        extern "C-unwind" {
209            fn CGFontGetXHeight(font: Option<&CGFont>) -> c_int;
210        }
211        unsafe { CGFontGetXHeight(font) }
212    }
213
214    #[doc(alias = "CGFontGetFontBBox")]
215    #[inline]
216    pub unsafe fn font_b_box(font: Option<&CGFont>) -> CGRect {
217        extern "C-unwind" {
218            fn CGFontGetFontBBox(font: Option<&CGFont>) -> CGRect;
219        }
220        unsafe { CGFontGetFontBBox(font) }
221    }
222
223    #[doc(alias = "CGFontGetItalicAngle")]
224    #[inline]
225    pub unsafe fn italic_angle(font: Option<&CGFont>) -> CGFloat {
226        extern "C-unwind" {
227            fn CGFontGetItalicAngle(font: Option<&CGFont>) -> CGFloat;
228        }
229        unsafe { CGFontGetItalicAngle(font) }
230    }
231
232    #[doc(alias = "CGFontGetStemV")]
233    #[inline]
234    pub unsafe fn stem_v(font: Option<&CGFont>) -> CGFloat {
235        extern "C-unwind" {
236            fn CGFontGetStemV(font: Option<&CGFont>) -> CGFloat;
237        }
238        unsafe { CGFontGetStemV(font) }
239    }
240
241    #[doc(alias = "CGFontCopyVariationAxes")]
242    #[inline]
243    pub unsafe fn variation_axes(font: Option<&CGFont>) -> Option<CFRetained<CFArray>> {
244        extern "C-unwind" {
245            fn CGFontCopyVariationAxes(font: Option<&CGFont>) -> Option<NonNull<CFArray>>;
246        }
247        let ret = unsafe { CGFontCopyVariationAxes(font) };
248        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
249    }
250
251    #[doc(alias = "CGFontCopyVariations")]
252    #[inline]
253    pub unsafe fn variations(font: Option<&CGFont>) -> Option<CFRetained<CFDictionary>> {
254        extern "C-unwind" {
255            fn CGFontCopyVariations(font: Option<&CGFont>) -> Option<NonNull<CFDictionary>>;
256        }
257        let ret = unsafe { CGFontCopyVariations(font) };
258        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
259    }
260
261    #[doc(alias = "CGFontGetGlyphAdvances")]
262    #[inline]
263    pub unsafe fn glyph_advances(
264        font: Option<&CGFont>,
265        glyphs: NonNull<CGGlyph>,
266        count: usize,
267        advances: NonNull<c_int>,
268    ) -> bool {
269        extern "C-unwind" {
270            fn CGFontGetGlyphAdvances(
271                font: Option<&CGFont>,
272                glyphs: NonNull<CGGlyph>,
273                count: usize,
274                advances: NonNull<c_int>,
275            ) -> bool;
276        }
277        unsafe { CGFontGetGlyphAdvances(font, glyphs, count, advances) }
278    }
279
280    #[doc(alias = "CGFontGetGlyphBBoxes")]
281    #[inline]
282    pub unsafe fn glyph_b_boxes(
283        font: Option<&CGFont>,
284        glyphs: NonNull<CGGlyph>,
285        count: usize,
286        bboxes: NonNull<CGRect>,
287    ) -> bool {
288        extern "C-unwind" {
289            fn CGFontGetGlyphBBoxes(
290                font: Option<&CGFont>,
291                glyphs: NonNull<CGGlyph>,
292                count: usize,
293                bboxes: NonNull<CGRect>,
294            ) -> bool;
295        }
296        unsafe { CGFontGetGlyphBBoxes(font, glyphs, count, bboxes) }
297    }
298
299    #[doc(alias = "CGFontGetGlyphWithGlyphName")]
300    #[inline]
301    pub unsafe fn glyph_with_glyph_name(font: Option<&CGFont>, name: Option<&CFString>) -> CGGlyph {
302        extern "C-unwind" {
303            fn CGFontGetGlyphWithGlyphName(
304                font: Option<&CGFont>,
305                name: Option<&CFString>,
306            ) -> CGGlyph;
307        }
308        unsafe { CGFontGetGlyphWithGlyphName(font, name) }
309    }
310
311    #[doc(alias = "CGFontCopyGlyphNameForGlyph")]
312    #[inline]
313    pub unsafe fn glyph_name_for_glyph(
314        font: Option<&CGFont>,
315        glyph: CGGlyph,
316    ) -> Option<CFRetained<CFString>> {
317        extern "C-unwind" {
318            fn CGFontCopyGlyphNameForGlyph(
319                font: Option<&CGFont>,
320                glyph: CGGlyph,
321            ) -> Option<NonNull<CFString>>;
322        }
323        let ret = unsafe { CGFontCopyGlyphNameForGlyph(font, glyph) };
324        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
325    }
326
327    #[doc(alias = "CGFontCanCreatePostScriptSubset")]
328    #[inline]
329    pub unsafe fn can_create_post_script_subset(
330        font: Option<&CGFont>,
331        format: CGFontPostScriptFormat,
332    ) -> bool {
333        extern "C-unwind" {
334            fn CGFontCanCreatePostScriptSubset(
335                font: Option<&CGFont>,
336                format: CGFontPostScriptFormat,
337            ) -> bool;
338        }
339        unsafe { CGFontCanCreatePostScriptSubset(font, format) }
340    }
341
342    #[doc(alias = "CGFontCopyTableTags")]
343    #[inline]
344    pub unsafe fn table_tags(font: Option<&CGFont>) -> Option<CFRetained<CFArray>> {
345        extern "C-unwind" {
346            fn CGFontCopyTableTags(font: Option<&CGFont>) -> Option<NonNull<CFArray>>;
347        }
348        let ret = unsafe { CGFontCopyTableTags(font) };
349        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
350    }
351
352    #[doc(alias = "CGFontCopyTableForTag")]
353    #[inline]
354    pub unsafe fn table_for_tag(font: Option<&CGFont>, tag: u32) -> Option<CFRetained<CFData>> {
355        extern "C-unwind" {
356            fn CGFontCopyTableForTag(font: Option<&CGFont>, tag: u32) -> Option<NonNull<CFData>>;
357        }
358        let ret = unsafe { CGFontCopyTableForTag(font, tag) };
359        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
360    }
361}
362
363extern "C" {
364    /// * Keys for the font variation axis dictionary. **
365    ///
366    /// See also [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontvariationaxisname?language=objc)
367    pub static kCGFontVariationAxisName: &'static CFString;
368}
369
370extern "C" {
371    /// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontvariationaxisminvalue?language=objc)
372    pub static kCGFontVariationAxisMinValue: &'static CFString;
373}
374
375extern "C" {
376    /// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontvariationaxismaxvalue?language=objc)
377    pub static kCGFontVariationAxisMaxValue: &'static CFString;
378}
379
380extern "C" {
381    /// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/kcgfontvariationaxisdefaultvalue?language=objc)
382    pub static kCGFontVariationAxisDefaultValue: &'static CFString;
383}
384
385/// [Apple's documentation](https://developer.apple.com/documentation/coregraphics/cgglyphdeprecatedenum?language=objc)
386// NS_ENUM
387#[repr(transparent)]
388#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
389pub struct CGGlyphDeprecatedEnum(pub i32);
390impl CGGlyphDeprecatedEnum {
391    #[doc(alias = "CGGlyphMin")]
392    pub const Min: Self = Self(0);
393    #[doc(alias = "CGGlyphMax")]
394    pub const Max: Self = Self(1);
395}
396
397#[cfg(feature = "objc2")]
398unsafe impl Encode for CGGlyphDeprecatedEnum {
399    const ENCODING: Encoding = i32::ENCODING;
400}
401
402#[cfg(feature = "objc2")]
403unsafe impl RefEncode for CGGlyphDeprecatedEnum {
404    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
405}
406
407#[deprecated = "renamed to `CGFont::with_platform_font`"]
408#[inline]
409pub unsafe extern "C-unwind" fn CGFontCreateWithPlatformFont(
410    platform_font_reference: *mut c_void,
411) -> Option<CFRetained<CGFont>> {
412    extern "C-unwind" {
413        fn CGFontCreateWithPlatformFont(
414            platform_font_reference: *mut c_void,
415        ) -> Option<NonNull<CGFont>>;
416    }
417    let ret = unsafe { CGFontCreateWithPlatformFont(platform_font_reference) };
418    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
419}
420
421#[cfg(feature = "CGDataProvider")]
422#[deprecated = "renamed to `CGFont::with_data_provider`"]
423#[inline]
424pub unsafe extern "C-unwind" fn CGFontCreateWithDataProvider(
425    provider: &CGDataProvider,
426) -> Option<CFRetained<CGFont>> {
427    extern "C-unwind" {
428        fn CGFontCreateWithDataProvider(provider: &CGDataProvider) -> Option<NonNull<CGFont>>;
429    }
430    let ret = unsafe { CGFontCreateWithDataProvider(provider) };
431    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
432}
433
434#[deprecated = "renamed to `CGFont::with_font_name`"]
435#[inline]
436pub unsafe extern "C-unwind" fn CGFontCreateWithFontName(
437    name: Option<&CFString>,
438) -> Option<CFRetained<CGFont>> {
439    extern "C-unwind" {
440        fn CGFontCreateWithFontName(name: Option<&CFString>) -> Option<NonNull<CGFont>>;
441    }
442    let ret = unsafe { CGFontCreateWithFontName(name) };
443    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
444}
445
446#[deprecated = "renamed to `CGFont::new_copy_with_variations`"]
447#[inline]
448pub unsafe extern "C-unwind" fn CGFontCreateCopyWithVariations(
449    font: Option<&CGFont>,
450    variations: Option<&CFDictionary>,
451) -> Option<CFRetained<CGFont>> {
452    extern "C-unwind" {
453        fn CGFontCreateCopyWithVariations(
454            font: Option<&CGFont>,
455            variations: Option<&CFDictionary>,
456        ) -> Option<NonNull<CGFont>>;
457    }
458    let ret = unsafe { CGFontCreateCopyWithVariations(font, variations) };
459    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
460}
461
462extern "C-unwind" {
463    #[deprecated = "renamed to `CGFont::number_of_glyphs`"]
464    pub fn CGFontGetNumberOfGlyphs(font: Option<&CGFont>) -> usize;
465}
466
467extern "C-unwind" {
468    #[deprecated = "renamed to `CGFont::units_per_em`"]
469    pub fn CGFontGetUnitsPerEm(font: Option<&CGFont>) -> c_int;
470}
471
472#[deprecated = "renamed to `CGFont::post_script_name`"]
473#[inline]
474pub unsafe extern "C-unwind" fn CGFontCopyPostScriptName(
475    font: Option<&CGFont>,
476) -> Option<CFRetained<CFString>> {
477    extern "C-unwind" {
478        fn CGFontCopyPostScriptName(font: Option<&CGFont>) -> Option<NonNull<CFString>>;
479    }
480    let ret = unsafe { CGFontCopyPostScriptName(font) };
481    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
482}
483
484#[deprecated = "renamed to `CGFont::full_name`"]
485#[inline]
486pub unsafe extern "C-unwind" fn CGFontCopyFullName(
487    font: Option<&CGFont>,
488) -> Option<CFRetained<CFString>> {
489    extern "C-unwind" {
490        fn CGFontCopyFullName(font: Option<&CGFont>) -> Option<NonNull<CFString>>;
491    }
492    let ret = unsafe { CGFontCopyFullName(font) };
493    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
494}
495
496extern "C-unwind" {
497    #[deprecated = "renamed to `CGFont::ascent`"]
498    pub fn CGFontGetAscent(font: Option<&CGFont>) -> c_int;
499}
500
501extern "C-unwind" {
502    #[deprecated = "renamed to `CGFont::descent`"]
503    pub fn CGFontGetDescent(font: Option<&CGFont>) -> c_int;
504}
505
506extern "C-unwind" {
507    #[deprecated = "renamed to `CGFont::leading`"]
508    pub fn CGFontGetLeading(font: Option<&CGFont>) -> c_int;
509}
510
511extern "C-unwind" {
512    #[deprecated = "renamed to `CGFont::cap_height`"]
513    pub fn CGFontGetCapHeight(font: Option<&CGFont>) -> c_int;
514}
515
516extern "C-unwind" {
517    #[deprecated = "renamed to `CGFont::x_height`"]
518    pub fn CGFontGetXHeight(font: Option<&CGFont>) -> c_int;
519}
520
521extern "C-unwind" {
522    #[deprecated = "renamed to `CGFont::font_b_box`"]
523    pub fn CGFontGetFontBBox(font: Option<&CGFont>) -> CGRect;
524}
525
526extern "C-unwind" {
527    #[deprecated = "renamed to `CGFont::italic_angle`"]
528    pub fn CGFontGetItalicAngle(font: Option<&CGFont>) -> CGFloat;
529}
530
531extern "C-unwind" {
532    #[deprecated = "renamed to `CGFont::stem_v`"]
533    pub fn CGFontGetStemV(font: Option<&CGFont>) -> CGFloat;
534}
535
536#[deprecated = "renamed to `CGFont::variation_axes`"]
537#[inline]
538pub unsafe extern "C-unwind" fn CGFontCopyVariationAxes(
539    font: Option<&CGFont>,
540) -> Option<CFRetained<CFArray>> {
541    extern "C-unwind" {
542        fn CGFontCopyVariationAxes(font: Option<&CGFont>) -> Option<NonNull<CFArray>>;
543    }
544    let ret = unsafe { CGFontCopyVariationAxes(font) };
545    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
546}
547
548#[deprecated = "renamed to `CGFont::variations`"]
549#[inline]
550pub unsafe extern "C-unwind" fn CGFontCopyVariations(
551    font: Option<&CGFont>,
552) -> Option<CFRetained<CFDictionary>> {
553    extern "C-unwind" {
554        fn CGFontCopyVariations(font: Option<&CGFont>) -> Option<NonNull<CFDictionary>>;
555    }
556    let ret = unsafe { CGFontCopyVariations(font) };
557    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
558}
559
560extern "C-unwind" {
561    #[deprecated = "renamed to `CGFont::glyph_advances`"]
562    pub fn CGFontGetGlyphAdvances(
563        font: Option<&CGFont>,
564        glyphs: NonNull<CGGlyph>,
565        count: usize,
566        advances: NonNull<c_int>,
567    ) -> bool;
568}
569
570extern "C-unwind" {
571    #[deprecated = "renamed to `CGFont::glyph_b_boxes`"]
572    pub fn CGFontGetGlyphBBoxes(
573        font: Option<&CGFont>,
574        glyphs: NonNull<CGGlyph>,
575        count: usize,
576        bboxes: NonNull<CGRect>,
577    ) -> bool;
578}
579
580extern "C-unwind" {
581    #[deprecated = "renamed to `CGFont::glyph_with_glyph_name`"]
582    pub fn CGFontGetGlyphWithGlyphName(font: Option<&CGFont>, name: Option<&CFString>) -> CGGlyph;
583}
584
585#[deprecated = "renamed to `CGFont::glyph_name_for_glyph`"]
586#[inline]
587pub unsafe extern "C-unwind" fn CGFontCopyGlyphNameForGlyph(
588    font: Option<&CGFont>,
589    glyph: CGGlyph,
590) -> Option<CFRetained<CFString>> {
591    extern "C-unwind" {
592        fn CGFontCopyGlyphNameForGlyph(
593            font: Option<&CGFont>,
594            glyph: CGGlyph,
595        ) -> Option<NonNull<CFString>>;
596    }
597    let ret = unsafe { CGFontCopyGlyphNameForGlyph(font, glyph) };
598    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
599}
600
601extern "C-unwind" {
602    #[deprecated = "renamed to `CGFont::can_create_post_script_subset`"]
603    pub fn CGFontCanCreatePostScriptSubset(
604        font: Option<&CGFont>,
605        format: CGFontPostScriptFormat,
606    ) -> bool;
607}
608
609#[deprecated = "renamed to `CGFont::table_tags`"]
610#[inline]
611pub unsafe extern "C-unwind" fn CGFontCopyTableTags(
612    font: Option<&CGFont>,
613) -> Option<CFRetained<CFArray>> {
614    extern "C-unwind" {
615        fn CGFontCopyTableTags(font: Option<&CGFont>) -> Option<NonNull<CFArray>>;
616    }
617    let ret = unsafe { CGFontCopyTableTags(font) };
618    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
619}
620
621#[deprecated = "renamed to `CGFont::table_for_tag`"]
622#[inline]
623pub unsafe extern "C-unwind" fn CGFontCopyTableForTag(
624    font: Option<&CGFont>,
625    tag: u32,
626) -> Option<CFRetained<CFData>> {
627    extern "C-unwind" {
628        fn CGFontCopyTableForTag(font: Option<&CGFont>, tag: u32) -> Option<NonNull<CFData>>;
629    }
630    let ret = unsafe { CGFontCopyTableForTag(font, tag) };
631    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
632}