Attempts to load a font with the specified characteristics.
Original signature is '- (NSFont *)fontWithFamily:(NSString *)family traits:(NSFontTraitMask)fontTraitMask weight:(NSInteger)weight size:(CGFloat)size'
Available in Mac OS X v10.0 and later.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public virtual NSFont FontWithFamilyTraitsWeightSize( NSString family, NSFontTraitMask fontTraitMask, NSInteger weight, CGFloat size )
Public Overridable Function FontWithFamilyTraitsWeightSize ( _ family As NSString, _ fontTraitMask As NSFontTraitMask, _ weight As NSInteger, _ size As CGFloat _ ) As NSFont
public: virtual NSFont^ FontWithFamilyTraitsWeightSize( NSString^ family, NSFontTraitMask fontTraitMask, NSInteger weight, CGFloat size )
Parameters
- family (NSString)
- The generic name of the desired font, such as Times or Helvetica.
- fontTraitMask (NSFontTraitMask)
- The font traits, specified by combining the font trait mask values described in “Constants” using the C bitwise OR operator. Using NSUnboldFontMask or NSUnitalicFontMask loads a font that doesn’t have either the bold or italic trait, respectively.
- weight (NSInteger)
- A hint for the weight desired, on a scale of 0 to 15: a value of 5 indicates a normal or book weight, and 9 or more a bold or heavier weight. The weight is ignored if fontTraitMask includes NSBoldFontMask.
- size (CGFloat)
- The point size of the desired font.
Return Value
A font with the specified characteristics if successful, or nil if not.
Version Information
- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)