Instance Method

withSize(_:)

Returns a new font descriptor that is the same as the receiver but with the specified point size.

Declaration

func withSize(_ newPointSize: CGFloat) -> NSFontDescriptor

Parameters

newPointSize

The new point size.

Return Value

The new font descriptor.

See Also

Creating a Font Descriptor

init(name: String, matrix: AffineTransform)

Returns a font descriptor with the NSFontNameAttribute and NSFontMatrixAttribute dictionary attributes set to the given values.

init(name: String, size: CGFloat)

Returns a font descriptor with the NSFontNameAttribute and NSFontSizeAttribute dictionary attributes set to the given values.

init(fontAttributes: [NSFontDescriptor.AttributeName : Any]?)

Initializes and returns a new font descriptor with the specified attributes.

func addingAttributes([NSFontDescriptor.AttributeName : Any]) -> NSFontDescriptor

Returns a new font descriptor that is the same as the receiver but with the specified attributes taking precedence over the existing ones.

func withFace(String) -> NSFontDescriptor

Returns a new font descriptor that is the same as the receiver but with the specified face.

func withFamily(String) -> NSFontDescriptor

Returns a new font descriptor whose attributes are the same as the receiver but from the specified family.

func withMatrix(AffineTransform) -> NSFontDescriptor

Returns a new font descriptor that is the same as the receiver but with the specified matrix.

func withSymbolicTraits(NSFontDescriptor.SymbolicTraits) -> NSFontDescriptor

Returns a new font descriptor that is the same as the receiver but with the specified symbolic traits taking precedence over the existing ones.