What values can be used in NSFont.TextStyleOptionKey

Viewed 256
1 Answers

These values were revealed by autocomplete in XCode:

        NSFont.Weight.black
        NSFont.Weight.heavy
        NSFont.Weight.bold
        NSFont.Weight.semibold
        NSFont.Weight.medium
        NSFont.Weight.regular
        NSFont.Weight.light
        NSFont.Weight.thin
        NSFont.Weight.ultraLight

The jump to definition command shows this:

extension NSFont.Weight {
    @available(macOS 10.11, *)
    public static let ultraLight: NSFont.Weight

    @available(macOS 10.11, *)
    public static let thin: NSFont.Weight

    @available(macOS 10.11, *)
    public static let light: NSFont.Weight

    @available(macOS 10.11, *)
    public static let regular: NSFont.Weight

    @available(macOS 10.11, *)
    public static let medium: NSFont.Weight

    @available(macOS 10.11, *)
    public static let semibold: NSFont.Weight

    @available(macOS 10.11, *)
    public static let bold: NSFont.Weight

    @available(macOS 10.11, *)
    public static let heavy: NSFont.Weight

    @available(macOS 10.11, *)
    public static let black: NSFont.Weight
}

other options can be found here in the doc: https://developer.apple.com/documentation/appkit/nsfont/textstyleoptionkey

Related