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


func CTFontCreateCopyWithSymbolicTraits(_ font: CTFont, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?, _ symTraitValue: CTFontSymbolicTraits, _ symTraitMask: CTFontSymbolicTraits) -> CTFont?



The original font reference on which to base the new font.


The point size for the font reference. If 0.0 is specified, the original font’s size is preserved.


The transformation matrix for the font. In most cases, set this parameter to be NULL. If NULL is specified, the original font's matrix is preserved.


The value of the symbolic traits.


The mask bits of the symbolic traits.

Return Value

A new font reference in the same family with the given symbolic traits. or NULL if none is found in the system.

See Also

Creating Fonts

func CTFontCreateWithFontDescriptor(CTFontDescriptor, CGFloat, UnsafePointer<CGAffineTransform>?) -> CTFont

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

func CTFontCreateUIFontForLanguage(CTFontUIFontType, CGFloat, CFString?) -> CTFont?

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

func CTFontCreateCopyWithFamily(CTFont, CGFloat, UnsafePointer<CGAffineTransform>?, CFString) -> CTFont?

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

func CTFontCreateForString(CTFont, CFString, CFRange) -> CTFont

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