CTFontCreateWithFontDescriptor(_:_:_:)
Returns a new font reference that best matches the given font descriptor.
Declaration
func CTFontCreateWithFontDescriptor(_ descriptor: CTFontDescriptor, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?) -> CTFontParameters
- descriptor:
A font descriptor containing attributes that specify the requested font.
- size:
The point size for the font reference. If
0.0is specified, the default font size of12.0is used. This parameter is optional. - matrix:
The transformation matrix for the font. In most cases, set this parameter to be
NULL. IfNULLis specified, the identity matrix is used. This parameter is optional.
Return Value
A CTFontRef that best matches the attributes provided with the font descriptor.
Discussion
The size and matrix parameters override any specified in the font descriptor unless they are unspecified (0.0 for size and NULL for matrix). A best match font is always returned, and default values are used for any unspecified parameters.
See Also
Creating Fonts
CTFontCreateWithName(_:_:_:)CTFontCreateWithNameAndOptions(_:_:_:_:)CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)CTFontCreateUIFontForLanguage(_:_:_:)CTFontCreateCopyWithAttributes(_:_:_:_:)CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:)CTFontCreateCopyWithFamily(_:_:_:_:)CTFontCreateForString(_:_:_:)CTFontCreateForStringWithLanguage(_:_:_:_:)