Returns the range of glyphs that are generated from the characters in the given character range.
SDKs
- iOS 7.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
- (NSRange)glyphRangeForCharacterRange:(NSRange)charRange actualCharacterRange:(NSRange Pointer)actualCharRange;
Parameters
charRange
The character range for which to return the generated glyph range.
actualCharRange
If not
NULL
, on output, points to the actual range of characters that fully define the glyph range returned. This range may be identical to or slightly larger than the requested character range. For example, if the text storage contains the characters "O
" and "¨
“, and the glyph store contains the single precomposed glyph "¨Ö
”, and ifchar
encloses only the first or second character, thenRange actual
is set to enclose both characters.Char Range
Return Value
The range of glyphs generated by char
.
Discussion
If the length of char
is 0
, the resulting glyph range is a zero-length range just after the glyph(s) corresponding to the preceding character, and actual
will also be zero-length. If char
extends beyond the text length, the method truncates the result to the number of glyphs in the text.
If noncontiguous layout is not enabled, this method forces the generation of glyphs for all characters up to and including the end of the specified range.