Returns a new font reference that can best map the given string range based on the current font.


func CTFontCreateForString(_ currentFont: CTFont, _ string: CFString, _ range: CFRange) -> CTFont



The current font that contains a valid cascade list.


A unicode string containing characters that cannot be encoded by the current font.


A CFRange structure specifying the range of the string that needs to be mapped.

Return Value

The best substitute font from the cascade list of the current font that can encode the specified string range. If the current font is capable of encoding the string range, then it is retained and returned.

See Also

Creating Fonts

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software