CTFontCreateForStringWithLanguage(_:_:_:_:)
Returns a font reference that most accurately maps the string range based on the current font and language.
Declaration
func CTFontCreateForStringWithLanguage(_ currentFont: CTFont, _ string: CFString, _ range: CFRange, _ language: CFString?) -> CTFontParameters
- 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 specifying the range of the string to map.
- language:
A language identifier to select a font for a particular localization.
Return Value
The best substitute font that can encode the specified string range.
Discussion
The current font itself can be returned if it covers the string provided. If the caller does not specify the language parameter, the function uses the current system language. The format of the language identifier should conform to UTS #35.
See Also
Related Documentation
Creating Fonts
CTFontCreateWithName(_:_:_:)CTFontCreateWithNameAndOptions(_:_:_:_:)CTFontCreateWithFontDescriptor(_:_:_:)CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)CTFontCreateUIFontForLanguage(_:_:_:)CTFontCreateCopyWithAttributes(_:_:_:_:)CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:)CTFontCreateCopyWithFamily(_:_:_:_:)CTFontCreateForString(_:_:_:)