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