UIFontAttributes.FeatureSettings Property

Definition

Typographic and layout feature settings.

public UIKit.UIFontFeature[] FeatureSettings { get; set; }
member this.FeatureSettings : UIKit.UIFontFeature[] with get, set

Property Value

Remarks

This property is an array of UIFontFeature objects, each representing a font-specific typograph or layout feature that can be enabled in the font. For background on Font Features, you can read https://developer.apple.com/fonts/registry

The following example shows how to configure the font to use proportional numbers as well as informing the rendering engine to use the 1st Character Alternatives available in this font.

UIFont CustomizeFont (UIFont font)
{
    var originalDescriptor = font.FontDescriptor;
    var attributes = new UIFontAttributes (
	new UIFontFeature (CTFontFeatureNumberSpacing.Selector.ProportionalNumbers),
	new UIFontFeature ((CTFontFeatureCharacterAlternatives.Selector)1));

    var newDesc = originalDescriptor.CreateWithAttributes (attributes);
    return UIFont.FromDescriptor (newDesc, 80);
}

Applies to