Contents

convert(_:toHaveTrait:)

Returns a new version of the font object containing a single additional trait.

Declaration

func convert(_ fontObj: NSFont, toHaveTrait trait: NSFontTraitMask) -> NSFont

Parameters

  • fontObj:

    The font whose traits are matched.

  • trait:

    The new trait; may be any one of the traits described in Constants. Using NSUnboldFontMask or NSUnitalicFontMask removes the bold or italic trait, respectively.

Return Value

A font with matching traits including the given trait, or aFont if it can’t be converted.

Discussion

Using NSUnboldFontMask or NSUnitalicFontMask removes the bold or italic trait, respectively.

See Also

Related Documentation

Converting Fonts Manually