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

An array of UIFontFeature objects representing the feature settings.

Remarks

This property is an array of UIFontFeature objects, each representing a font-specific typographic 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 first 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