Instance Method

fontDescriptorWithDesign:

Returns a new font descriptor that is the same as the existing descriptor, but with the specified design.

Declaration

- (UIFontDescriptor *)fontDescriptorWithDesign:(UIFontDescriptorSystemDesign)design;

Parameters

design

The new system font design.

Return Value

The new font descriptor, if the original font descriptor is from a system UI font; otherwise, nil.

Discussion

This method changes the design of an existing font descriptor that describes a system UI font—for example, a font descriptor created by methods such as systemFontOfSize:, preferredFontForTextStyle:, or preferredFontDescriptorWithTextStyle:. If the original font descriptor does not describe a system font, this method returns nil.

See Also

Creating a Font Descriptor

+ preferredFontDescriptorWithTextStyle:

Returns a font descriptor containing the given text style and the user's selected content size category.

+ preferredFontDescriptorWithTextStyle:compatibleWithTraitCollection:

Returns a font descriptor containing the text style and the content size category specified by the provided trait collection.

+ fontDescriptorWithFontAttributes:

Returns a font descriptor with a dictionary of attributes.

+ fontDescriptorWithName:matrix:

Returns a font descriptor with the UIFontDescriptorNameAttribute and UIFontDescriptorMatrixAttribute dictionary attributes set to the given values.

+ fontDescriptorWithName:size:

Returns a font descriptor with the UIFontDescriptorNameAttribute and UIFontDescriptorSizeAttribute dictionary attributes set to the given values.

- fontDescriptorByAddingAttributes:

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

- fontDescriptorWithFamily:

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

- fontDescriptorWithFace:

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

- fontDescriptorWithMatrix:

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

- fontDescriptorWithSize:

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

- fontDescriptorWithSymbolicTraits:

Returns a new font descriptor that is the same as the existing font descriptor, but with the specified symbolic traits.