Instance Method

fontNamed:hasTraits:

Indicates whether the given font has all the specified traits.

Declaration

- (BOOL)fontNamed:(NSString *)fName hasTraits:(NSFontTraitMask)someTraits;

Parameters

typeface

The name of the font.

fontTraitMask

The font traits to test, specified by combining the font trait mask values described in Constants using the C bitwise OR operator.

Return Value

YES if the font named typeface has all the traits specified in fontTraitMask; NO if it doesn’t.

Discussion

Using NSUnboldFontMask returns YES if the font is not bold, NO otherwise. Using NSUnitalicFontMask returns YES if the font is not italic, NO otherwise.

See Also

Examining Fonts

- traitsOfFont:

Returns the traits of the given font.

- weightOfFont:

Returns an approximation of the weight of the given font.