編集

次の方法で共有


UIFontDescriptor.FeatureSettings Property

Definition

Typographic and layout feature settings.

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

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);
}

This can be used from a background thread.

Applies to