objc2_core_text/generated/
CTRun.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#[cfg(feature = "objc2-core-graphics")]
11use objc2_core_graphics::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/coretext/ctrun?language=objc)
16#[repr(C)]
17pub struct CTRun {
18    inner: [u8; 0],
19    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
20}
21
22cf_type!(
23    unsafe impl CTRun {}
24);
25#[cfg(feature = "objc2")]
26cf_objc2_type!(
27    unsafe impl RefEncode<"__CTRun"> for CTRun {}
28);
29
30/// A bitfield passed back by CTRunGetStatus that is used to
31/// indicate the disposition of the run.
32///
33///
34/// The run has no special attributes.
35///
36///
37/// When set, the run is right to left.
38///
39///
40/// When set, the run has been reordered in some way such that
41/// the string indices associated with the glyphs are no longer
42/// strictly increasing (for left to right runs) or decreasing
43/// (for right to left runs).
44///
45///
46/// When set, the run requires a specific text matrix to be set
47/// in the current CG context for proper drawing.
48///
49/// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/ctrunstatus?language=objc)
50// NS_OPTIONS
51#[repr(transparent)]
52#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
53pub struct CTRunStatus(pub u32);
54bitflags::bitflags! {
55    impl CTRunStatus: u32 {
56        #[doc(alias = "kCTRunStatusNoStatus")]
57        const NoStatus = 0;
58        #[doc(alias = "kCTRunStatusRightToLeft")]
59        const RightToLeft = 1<<0;
60        #[doc(alias = "kCTRunStatusNonMonotonic")]
61        const NonMonotonic = 1<<1;
62        #[doc(alias = "kCTRunStatusHasNonIdentityMatrix")]
63        const HasNonIdentityMatrix = 1<<2;
64    }
65}
66
67#[cfg(feature = "objc2")]
68unsafe impl Encode for CTRunStatus {
69    const ENCODING: Encoding = u32::ENCODING;
70}
71
72#[cfg(feature = "objc2")]
73unsafe impl RefEncode for CTRunStatus {
74    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
75}
76
77unsafe impl ConcreteType for CTRun {
78    /// Returns the CFType of the run object
79    #[doc(alias = "CTRunGetTypeID")]
80    #[inline]
81    fn type_id() -> CFTypeID {
82        extern "C-unwind" {
83            fn CTRunGetTypeID() -> CFTypeID;
84        }
85        unsafe { CTRunGetTypeID() }
86    }
87}
88
89impl CTRun {
90    /// Gets the glyph count for the run.
91    ///
92    ///
93    /// Parameter `run`: The run whose glyph count you wish to access.
94    ///
95    ///
96    /// Returns: The number of glyphs that the run contains. It is totally
97    /// possible that this function could return a value of zero,
98    /// indicating that there are no glyphs in this run.
99    #[doc(alias = "CTRunGetGlyphCount")]
100    #[inline]
101    pub unsafe fn glyph_count(self: &CTRun) -> CFIndex {
102        extern "C-unwind" {
103            fn CTRunGetGlyphCount(run: &CTRun) -> CFIndex;
104        }
105        unsafe { CTRunGetGlyphCount(self) }
106    }
107
108    /// Returns the attribute dictionary that was used to create the
109    /// glyph run.
110    ///
111    ///
112    /// This dictionary returned is either the same exact one that was
113    /// set as an attribute dictionary on the original attributed string
114    /// or a dictionary that has been manufactured by the layout engine.
115    /// Attribute dictionaries can be manufactured in the case of font
116    /// substitution or if they are missing critical attributes.
117    ///
118    ///
119    /// Parameter `run`: The run whose attributes you wish to access.
120    ///
121    ///
122    /// Returns: The attribute dictionary.
123    #[doc(alias = "CTRunGetAttributes")]
124    #[inline]
125    pub unsafe fn attributes(self: &CTRun) -> CFRetained<CFDictionary> {
126        extern "C-unwind" {
127            fn CTRunGetAttributes(run: &CTRun) -> Option<NonNull<CFDictionary>>;
128        }
129        let ret = unsafe { CTRunGetAttributes(self) };
130        let ret =
131            ret.expect("function was marked as returning non-null, but actually returned NULL");
132        unsafe { CFRetained::retain(ret) }
133    }
134
135    /// Returns the run's status.
136    ///
137    ///
138    /// In addition to attributes, runs also have status that can be
139    /// used to expedite certain operations. Knowing the direction and
140    /// ordering of a run's glyphs can aid in string index analysis,
141    /// whereas knowing whether the positions reference the identity
142    /// text matrix can avoid expensive comparisons. Note that this
143    /// status is provided as a convenience, since this information is
144    /// not strictly necessary but can certainly be helpful.
145    ///
146    ///
147    /// Parameter `run`: The run whose status you wish to access.
148    ///
149    ///
150    /// Returns: The run's status.
151    #[doc(alias = "CTRunGetStatus")]
152    #[inline]
153    pub unsafe fn status(self: &CTRun) -> CTRunStatus {
154        extern "C-unwind" {
155            fn CTRunGetStatus(run: &CTRun) -> CTRunStatus;
156        }
157        unsafe { CTRunGetStatus(self) }
158    }
159
160    /// Returns a direct pointer for the glyph array stored in the run.
161    ///
162    ///
163    /// The glyph array will have a length equal to the value returned by
164    /// CTRunGetGlyphCount. The caller should be prepared for this
165    /// function to return NULL even if there are glyphs in the stream.
166    /// Should this function return NULL, the caller will need to
167    /// allocate their own buffer and call CTRunGetGlyphs to fetch the
168    /// glyphs.
169    ///
170    ///
171    /// Parameter `run`: The run whose glyphs you wish to access.
172    ///
173    ///
174    /// Returns: A valid pointer to an array of CGGlyph structures or NULL.
175    #[doc(alias = "CTRunGetGlyphsPtr")]
176    #[cfg(feature = "objc2-core-graphics")]
177    #[inline]
178    pub unsafe fn glyphs_ptr(self: &CTRun) -> *const CGGlyph {
179        extern "C-unwind" {
180            fn CTRunGetGlyphsPtr(run: &CTRun) -> *const CGGlyph;
181        }
182        unsafe { CTRunGetGlyphsPtr(self) }
183    }
184
185    /// Copies a range of glyphs into user-provided buffer.
186    ///
187    ///
188    /// Parameter `run`: The run whose glyphs you wish to copy.
189    ///
190    ///
191    /// Parameter `range`: The range of glyphs to be copied, with the entire range having a
192    /// location of 0 and a length of CTRunGetGlyphCount. If the length
193    /// of the range is set to 0, then the operation will continue from
194    /// the range's start index to the end of the run.
195    ///
196    ///
197    /// Parameter `buffer`: The buffer where the glyphs will be copied to. The buffer must be
198    /// allocated to at least the value specified by the range's length.
199    #[doc(alias = "CTRunGetGlyphs")]
200    #[cfg(feature = "objc2-core-graphics")]
201    #[inline]
202    pub unsafe fn glyphs(self: &CTRun, range: CFRange, buffer: NonNull<CGGlyph>) {
203        extern "C-unwind" {
204            fn CTRunGetGlyphs(run: &CTRun, range: CFRange, buffer: NonNull<CGGlyph>);
205        }
206        unsafe { CTRunGetGlyphs(self, range, buffer) }
207    }
208
209    /// Returns a direct pointer for the glyph position array stored in
210    /// the run.
211    ///
212    ///
213    /// The glyph positions in a run are relative to the origin of the
214    /// line containing the run. The position array will have a length
215    /// equal to the value returned by CTRunGetGlyphCount. The caller
216    /// should be prepared for this function to return NULL even if there
217    /// are glyphs in the stream. Should this function return NULL, the
218    /// caller will need to allocate their own buffer and call
219    /// CTRunGetPositions to fetch the positions.
220    ///
221    ///
222    /// Parameter `run`: The run whose positions you wish to access.
223    ///
224    ///
225    /// Returns: A valid pointer to an array of CGPoint structures or NULL.
226    #[doc(alias = "CTRunGetPositionsPtr")]
227    #[inline]
228    pub unsafe fn positions_ptr(self: &CTRun) -> *const CGPoint {
229        extern "C-unwind" {
230            fn CTRunGetPositionsPtr(run: &CTRun) -> *const CGPoint;
231        }
232        unsafe { CTRunGetPositionsPtr(self) }
233    }
234
235    /// Copies a range of glyph positions into a user-provided buffer.
236    ///
237    ///
238    /// The glyph positions in a run are relative to the origin of the
239    /// line containing the run.
240    ///
241    ///
242    /// Parameter `run`: The run whose positions you wish to copy.
243    ///
244    ///
245    /// Parameter `range`: The range of glyph positions to be copied, with the entire range
246    /// having a location of 0 and a length of CTRunGetGlyphCount. If the
247    /// length of the range is set to 0, then the operation will continue
248    /// from the range's start index to the end of the run.
249    ///
250    ///
251    /// Parameter `buffer`: The buffer where the glyph positions will be copied to. The buffer
252    /// must be allocated to at least the value specified by the range's
253    /// length.
254    #[doc(alias = "CTRunGetPositions")]
255    #[inline]
256    pub unsafe fn positions(self: &CTRun, range: CFRange, buffer: NonNull<CGPoint>) {
257        extern "C-unwind" {
258            fn CTRunGetPositions(run: &CTRun, range: CFRange, buffer: NonNull<CGPoint>);
259        }
260        unsafe { CTRunGetPositions(self, range, buffer) }
261    }
262
263    /// Returns a direct pointer for the glyph advance array stored in
264    /// the run.
265    ///
266    ///
267    /// The advance array will have a length equal to the value returned
268    /// by CTRunGetGlyphCount. The caller should be prepared for this
269    /// function to return NULL even if there are glyphs in the stream.
270    /// Should this function return NULL, the caller will need to
271    /// allocate their own buffer and call CTRunGetAdvances to fetch the
272    /// advances. Note that advances alone are not sufficient for correctly
273    /// positioning glyphs in a line, as a run may have a non-identity
274    /// matrix or the initial glyph in a line may have a non-zero origin;
275    /// callers should consider using positions instead.
276    ///
277    ///
278    /// Parameter `run`: The run whose advances you wish to access.
279    ///
280    ///
281    /// Returns: A valid pointer to an array of CGSize structures or NULL.
282    #[doc(alias = "CTRunGetAdvancesPtr")]
283    #[inline]
284    pub unsafe fn advances_ptr(self: &CTRun) -> *const CGSize {
285        extern "C-unwind" {
286            fn CTRunGetAdvancesPtr(run: &CTRun) -> *const CGSize;
287        }
288        unsafe { CTRunGetAdvancesPtr(self) }
289    }
290
291    /// Copies a range of glyph advances into a user-provided buffer.
292    ///
293    ///
294    /// Parameter `run`: The run whose advances you wish to copy.
295    ///
296    ///
297    /// Parameter `range`: The range of glyph advances to be copied, with the entire range
298    /// having a location of 0 and a length of CTRunGetGlyphCount. If the
299    /// length of the range is set to 0, then the operation will continue
300    /// from the range's start index to the end of the run.
301    ///
302    ///
303    /// Parameter `buffer`: The buffer where the glyph advances will be copied to. The buffer
304    /// must be allocated to at least the value specified by the range's
305    /// length.
306    #[doc(alias = "CTRunGetAdvances")]
307    #[inline]
308    pub unsafe fn advances(self: &CTRun, range: CFRange, buffer: NonNull<CGSize>) {
309        extern "C-unwind" {
310            fn CTRunGetAdvances(run: &CTRun, range: CFRange, buffer: NonNull<CGSize>);
311        }
312        unsafe { CTRunGetAdvances(self, range, buffer) }
313    }
314
315    /// Returns a direct pointer for the string indices stored in the run.
316    ///
317    ///
318    /// The indices are the character indices that originally spawned the
319    /// glyphs that make up the run. They can be used to map the glyphs in
320    /// the run back to the characters in the backing store. The string
321    /// indices array will have a length equal to the value returned by
322    /// CTRunGetGlyphCount. The caller should be prepared for this
323    /// function to return NULL even if there are glyphs in the stream.
324    /// Should this function return NULL, the caller will need to allocate
325    /// their own buffer and call CTRunGetStringIndices to fetch the
326    /// indices.
327    ///
328    ///
329    /// Parameter `run`: The run whose string indices you wish to access.
330    ///
331    ///
332    /// Returns: A valid pointer to an array of CFIndex structures or NULL.
333    #[doc(alias = "CTRunGetStringIndicesPtr")]
334    #[inline]
335    pub unsafe fn string_indices_ptr(self: &CTRun) -> *const CFIndex {
336        extern "C-unwind" {
337            fn CTRunGetStringIndicesPtr(run: &CTRun) -> *const CFIndex;
338        }
339        unsafe { CTRunGetStringIndicesPtr(self) }
340    }
341
342    /// Copies a range of string indices into a user-provided buffer.
343    ///
344    ///
345    /// The indices are the character indices that originally spawned the
346    /// glyphs that make up the run. They can be used to map the glyphs
347    /// in the run back to the characters in the backing store.
348    ///
349    ///
350    /// Parameter `run`: The run whose string indices you wish to copy.
351    ///
352    ///
353    /// Parameter `range`: The range of string indices to be copied, with the entire range
354    /// having a location of 0 and a length of CTRunGetGlyphCount. If the
355    /// length of the range is set to 0, then the operation will continue
356    /// from the range's start index to the end of the run.
357    ///
358    ///
359    /// Parameter `buffer`: The buffer where the string indices will be copied to. The buffer
360    /// must be allocated to at least the value specified by the range's
361    /// length.
362    #[doc(alias = "CTRunGetStringIndices")]
363    #[inline]
364    pub unsafe fn string_indices(self: &CTRun, range: CFRange, buffer: NonNull<CFIndex>) {
365        extern "C-unwind" {
366            fn CTRunGetStringIndices(run: &CTRun, range: CFRange, buffer: NonNull<CFIndex>);
367        }
368        unsafe { CTRunGetStringIndices(self, range, buffer) }
369    }
370
371    /// Gets the range of characters that originally spawned the glyphs
372    /// in the run.
373    ///
374    ///
375    /// Parameter `run`: The run whose string range you wish to access.
376    ///
377    ///
378    /// Returns: Returns the range of characters that originally spawned the
379    /// glyphs. If run is invalid, this will return an empty range.
380    #[doc(alias = "CTRunGetStringRange")]
381    #[inline]
382    pub unsafe fn string_range(self: &CTRun) -> CFRange {
383        extern "C-unwind" {
384            fn CTRunGetStringRange(run: &CTRun) -> CFRange;
385        }
386        unsafe { CTRunGetStringRange(self) }
387    }
388
389    /// Gets the typographic bounds of the run.
390    ///
391    ///
392    /// Parameter `run`: The run that you want to calculate the typographic bounds for.
393    ///
394    ///
395    /// Parameter `range`: The range of glyphs to be measured, with the entire range having
396    /// a location of 0 and a length of CTRunGetGlyphCount. If the length
397    /// of the range is set to 0, then the operation will continue from
398    /// the range's start index to the end of the run.
399    ///
400    ///
401    /// Parameter `ascent`: Upon return, this parameter will contain the ascent of the run.
402    /// This may be set to NULL if not needed.
403    ///
404    ///
405    /// Parameter `descent`: Upon return, this parameter will contain the descent of the run.
406    /// This may be set to NULL if not needed.
407    ///
408    ///
409    /// Parameter `leading`: Upon return, this parameter will contain the leading of the run.
410    /// This may be set to NULL if not needed.
411    ///
412    ///
413    /// Returns: The typographic width of the run. If run or range is
414    /// invalid, then this function will always return zero.
415    #[doc(alias = "CTRunGetTypographicBounds")]
416    #[inline]
417    pub unsafe fn typographic_bounds(
418        self: &CTRun,
419        range: CFRange,
420        ascent: *mut CGFloat,
421        descent: *mut CGFloat,
422        leading: *mut CGFloat,
423    ) -> c_double {
424        extern "C-unwind" {
425            fn CTRunGetTypographicBounds(
426                run: &CTRun,
427                range: CFRange,
428                ascent: *mut CGFloat,
429                descent: *mut CGFloat,
430                leading: *mut CGFloat,
431            ) -> c_double;
432        }
433        unsafe { CTRunGetTypographicBounds(self, range, ascent, descent, leading) }
434    }
435
436    /// Calculates the image bounds for a glyph range.
437    ///
438    ///
439    /// The image bounds for a run is the union of all non-empty glyph
440    /// bounding rects, each positioned as it would be if drawn using
441    /// CTRunDraw using the current context (for clients linked against
442    /// macOS High Sierra or iOS 11 and later) or the text position of
443    /// the supplied context (for all others). Note that the result is
444    /// ideal and does not account for raster coverage due to rendering.
445    /// This function is purely a convenience for using glyphs as an
446    /// image and should not be used for typographic purposes.
447    ///
448    ///
449    /// Parameter `run`: The run that you want to calculate the image bounds for.
450    ///
451    ///
452    /// Parameter `context`: The context which the image bounds will be calculated for or NULL,
453    /// in which case the bounds are relative to CGPointZero.
454    ///
455    ///
456    /// Parameter `range`: The range of glyphs to be measured, with the entire range having
457    /// a location of 0 and a length of CTRunGetGlyphCount. If the length
458    /// of the range is set to 0, then the operation will continue from
459    /// the range's start index to the end of the run.
460    ///
461    ///
462    /// Returns: A rect that tightly encloses the paths of the run's glyphs. The
463    /// rect origin will match the drawn position of the requested range;
464    /// that is, it will be translated by the supplied context's text
465    /// position and the positions of the individual glyphs. If the run
466    /// or range is invalid, CGRectNull will be returned.
467    ///
468    ///
469    /// See also: CTRunGetTypographicBounds
470    #[doc(alias = "CTRunGetImageBounds")]
471    #[cfg(feature = "objc2-core-graphics")]
472    #[inline]
473    pub unsafe fn image_bounds(
474        self: &CTRun,
475        context: Option<&CGContext>,
476        range: CFRange,
477    ) -> CGRect {
478        extern "C-unwind" {
479            fn CTRunGetImageBounds(
480                run: &CTRun,
481                context: Option<&CGContext>,
482                range: CFRange,
483            ) -> CGRect;
484        }
485        unsafe { CTRunGetImageBounds(self, context, range) }
486    }
487
488    /// Returns the text matrix needed to draw this run.
489    ///
490    ///
491    /// To properly draw the glyphs in a run, the fields 'tx' and 'ty' of
492    /// the CGAffineTransform returned by this function should be set to
493    /// the current text position.
494    ///
495    ///
496    /// Parameter `run`: The run object from which to get the text matrix.
497    ///
498    ///
499    /// Returns: A CGAffineTransform.
500    #[doc(alias = "CTRunGetTextMatrix")]
501    #[inline]
502    pub unsafe fn text_matrix(self: &CTRun) -> CGAffineTransform {
503        extern "C-unwind" {
504            fn CTRunGetTextMatrix(run: &CTRun) -> CGAffineTransform;
505        }
506        unsafe { CTRunGetTextMatrix(self) }
507    }
508
509    /// Copies a range of base advances and/or origins into user-provided
510    /// buffers.
511    ///
512    ///
513    /// A run's base advances and origins determine the positions of its
514    /// glyphs but require additional processing before being used for
515    /// drawing. Similar to the advances returned by CTRunGetAdvances,
516    /// base advances are the displacement from the origin of a glyph
517    /// to the origin of the next glyph, except base advances do not
518    /// include any positioning the font layout tables may have done
519    /// relative to another glyph (such as a mark relative to its base).
520    /// The actual position of the current glyph is determined by the
521    /// displacement of its origin from the starting position, and the
522    /// position of the next glyph by the displacement of the current
523    /// glyph's base advance from the starting position.
524    ///
525    ///
526    /// Parameter `runRef`: The run whose base advances and/or origins you wish to copy.
527    ///
528    ///
529    /// Parameter `range`: The range of values to be copied. If the length of the
530    /// range is set to 0, then the copy operation will continue from the
531    /// range's start index to the end of the run.
532    ///
533    ///
534    /// Parameter `advancesBuffer`: The buffer where the base advances will be copied to, or NULL.
535    /// If not NULL, the buffer must allow for at least as many elements
536    /// as specified by the range's length.
537    ///
538    ///
539    /// Parameter `originsBuffer`: The buffer where the origins will be copied to, or NULL. If not
540    /// NULL, the buffer must allow for at least as many elements as
541    /// specified by the range's length.
542    #[doc(alias = "CTRunGetBaseAdvancesAndOrigins")]
543    #[inline]
544    pub unsafe fn base_advances_and_origins(
545        self: &CTRun,
546        range: CFRange,
547        advances_buffer: *mut CGSize,
548        origins_buffer: *mut CGPoint,
549    ) {
550        extern "C-unwind" {
551            fn CTRunGetBaseAdvancesAndOrigins(
552                run_ref: &CTRun,
553                range: CFRange,
554                advances_buffer: *mut CGSize,
555                origins_buffer: *mut CGPoint,
556            );
557        }
558        unsafe { CTRunGetBaseAdvancesAndOrigins(self, range, advances_buffer, origins_buffer) }
559    }
560
561    /// Draws a complete run or part of one.
562    ///
563    ///
564    /// This is a convenience call, since the run could also be drawn by
565    /// accessing its glyphs, positions, and text matrix. Unlike when
566    /// drawing the entire line containing the run with CTLineDraw, the
567    /// run's underline (if any) will not be drawn, since the underline's
568    /// appearance may depend on other runs in the line. This call may
569    /// leave the graphics context in any state and does not flush the
570    /// context after drawing. This call also expects a text matrix with
571    /// `y` values increasing from bottom to top; a flipped text matrix
572    /// may result in misplaced diacritics.
573    ///
574    ///
575    /// Parameter `run`: The run that you want to draw.
576    ///
577    ///
578    /// Parameter `context`: The context to draw the run to.
579    ///
580    ///
581    /// Parameter `range`: The range of glyphs to be drawn, with the entire range having a
582    /// location of 0 and a length of CTRunGetGlyphCount. If the length
583    /// of the range is set to 0, then the operation will continue from
584    /// the range's start index to the end of the run.
585    #[doc(alias = "CTRunDraw")]
586    #[cfg(feature = "objc2-core-graphics")]
587    #[inline]
588    pub unsafe fn draw(self: &CTRun, context: &CGContext, range: CFRange) {
589        extern "C-unwind" {
590            fn CTRunDraw(run: &CTRun, context: &CGContext, range: CFRange);
591        }
592        unsafe { CTRunDraw(self, context, range) }
593    }
594}
595
596extern "C-unwind" {
597    #[deprecated = "renamed to `CTRun::glyph_count`"]
598    pub fn CTRunGetGlyphCount(run: &CTRun) -> CFIndex;
599}
600
601#[deprecated = "renamed to `CTRun::attributes`"]
602#[inline]
603pub unsafe extern "C-unwind" fn CTRunGetAttributes(run: &CTRun) -> CFRetained<CFDictionary> {
604    extern "C-unwind" {
605        fn CTRunGetAttributes(run: &CTRun) -> Option<NonNull<CFDictionary>>;
606    }
607    let ret = unsafe { CTRunGetAttributes(run) };
608    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
609    unsafe { CFRetained::retain(ret) }
610}
611
612extern "C-unwind" {
613    #[deprecated = "renamed to `CTRun::status`"]
614    pub fn CTRunGetStatus(run: &CTRun) -> CTRunStatus;
615}
616
617extern "C-unwind" {
618    #[cfg(feature = "objc2-core-graphics")]
619    #[deprecated = "renamed to `CTRun::glyphs_ptr`"]
620    pub fn CTRunGetGlyphsPtr(run: &CTRun) -> *const CGGlyph;
621}
622
623extern "C-unwind" {
624    #[cfg(feature = "objc2-core-graphics")]
625    #[deprecated = "renamed to `CTRun::glyphs`"]
626    pub fn CTRunGetGlyphs(run: &CTRun, range: CFRange, buffer: NonNull<CGGlyph>);
627}
628
629extern "C-unwind" {
630    #[deprecated = "renamed to `CTRun::positions_ptr`"]
631    pub fn CTRunGetPositionsPtr(run: &CTRun) -> *const CGPoint;
632}
633
634extern "C-unwind" {
635    #[deprecated = "renamed to `CTRun::positions`"]
636    pub fn CTRunGetPositions(run: &CTRun, range: CFRange, buffer: NonNull<CGPoint>);
637}
638
639extern "C-unwind" {
640    #[deprecated = "renamed to `CTRun::advances_ptr`"]
641    pub fn CTRunGetAdvancesPtr(run: &CTRun) -> *const CGSize;
642}
643
644extern "C-unwind" {
645    #[deprecated = "renamed to `CTRun::advances`"]
646    pub fn CTRunGetAdvances(run: &CTRun, range: CFRange, buffer: NonNull<CGSize>);
647}
648
649extern "C-unwind" {
650    #[deprecated = "renamed to `CTRun::string_indices_ptr`"]
651    pub fn CTRunGetStringIndicesPtr(run: &CTRun) -> *const CFIndex;
652}
653
654extern "C-unwind" {
655    #[deprecated = "renamed to `CTRun::string_indices`"]
656    pub fn CTRunGetStringIndices(run: &CTRun, range: CFRange, buffer: NonNull<CFIndex>);
657}
658
659extern "C-unwind" {
660    #[deprecated = "renamed to `CTRun::string_range`"]
661    pub fn CTRunGetStringRange(run: &CTRun) -> CFRange;
662}
663
664extern "C-unwind" {
665    #[deprecated = "renamed to `CTRun::typographic_bounds`"]
666    pub fn CTRunGetTypographicBounds(
667        run: &CTRun,
668        range: CFRange,
669        ascent: *mut CGFloat,
670        descent: *mut CGFloat,
671        leading: *mut CGFloat,
672    ) -> c_double;
673}
674
675extern "C-unwind" {
676    #[cfg(feature = "objc2-core-graphics")]
677    #[deprecated = "renamed to `CTRun::image_bounds`"]
678    pub fn CTRunGetImageBounds(run: &CTRun, context: Option<&CGContext>, range: CFRange) -> CGRect;
679}
680
681extern "C-unwind" {
682    #[deprecated = "renamed to `CTRun::text_matrix`"]
683    pub fn CTRunGetTextMatrix(run: &CTRun) -> CGAffineTransform;
684}
685
686extern "C-unwind" {
687    #[deprecated = "renamed to `CTRun::base_advances_and_origins`"]
688    pub fn CTRunGetBaseAdvancesAndOrigins(
689        run_ref: &CTRun,
690        range: CFRange,
691        advances_buffer: *mut CGSize,
692        origins_buffer: *mut CGPoint,
693    );
694}
695
696extern "C-unwind" {
697    #[cfg(feature = "objc2-core-graphics")]
698    #[deprecated = "renamed to `CTRun::draw`"]
699    pub fn CTRunDraw(run: &CTRun, context: &CGContext, range: CFRange);
700}