Function

CTFontCreateForString

Returns a font reference that most accurately maps the string range based on the current font.

Declaration

CTFontRef CTFontCreateForString(CTFontRef currentFont, CFStringRef string, CFRange range);

Parameters

currentFont

The current font that contains a valid cascade list.

string

A Unicode string containing characters that can’t be encoded by the current font.

range

A CFRange structure specifying the range of the string to map.

Return Value

The best substitute font from the cascade list of the current font that can encode the specified string range.

Discussion

If the current font can encode the string range, the function retains and returns the font.

See Also

Creating Fonts

CTFontCreateWithName

Returns a new font reference for the given name.

CTFontCreateWithNameAndOptions

Returns a new font reference for the given name.

CTFontCreateWithFontDescriptor

Returns a new font reference that best matches the given font descriptor.

CTFontCreateWithFontDescriptorAndOptions

Returns a new font reference that best matches the given font descriptor.

CTFontCreateUIFontForLanguage

Returns the special user-interface font for the given language and user-interface type.

CTFontCreateCopyWithAttributes

Returns a new font with additional attributes based on the original font.

CTFontCreateCopyWithSymbolicTraits

Returns a new font in the same font family as the original with the specified symbolic traits.

CTFontCreateCopyWithFamily

Returns a new font in the specified family based on the traits of the original font.

CTFontCreateForStringWithLanguage

Returns a font reference that most accurately maps the string range based on the current font and language.