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