Font traits

Font traits defined and supported by NSFontManager.

Overview

NSFontManager categorizes fonts according to a small set of traits. You can convert fonts by adding and removing individual traits, and you can get a font with a specific combination of traits.

These pairs of traits are mutually exclusive:

  • NSCondensedFontMask and NSExpandedFontMask

  • NSBoldFontMask and NSUnboldFontMask

  • NSItalicFontMask and NSUnitalicFontMask

Topics

Constants

static var italicFontMask: NSFontTraitMask

A mask that specifies an italic font.

static var boldFontMask: NSFontTraitMask

A mask that specifies a bold font.

static var unboldFontMask: NSFontTraitMask

A mask that specifies a font that is not bold.

static var nonStandardCharacterSetFontMask: NSFontTraitMask

A mask that specifies a font that uses a non-standard character set.

static var narrowFontMask: NSFontTraitMask

A mask that specifies a narrow font.

static var expandedFontMask: NSFontTraitMask

A mask that specifies an expanded font.

static var condensedFontMask: NSFontTraitMask

A mask that specifies a condensed font.

static var smallCapsFontMask: NSFontTraitMask

A mask that specifies a small-caps font.

static var posterFontMask: NSFontTraitMask

A mask that specifies a poster-style font.

static var compressedFontMask: NSFontTraitMask

A mask that specifies a compressed font.

static var fixedPitchFontMask: NSFontTraitMask

A mask that specifies a fixed pitch font.

static var unitalicFontMask: NSFontTraitMask

A mask that specifies a font that is not italic.