Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSFontManagerMBS class.

Previous items

NSFontManagerMBS.traitsOfFont(font as NSFontMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the traits of the given font.
Example
dim n as NSFontMBS = NSFontMBS.boldSystemFontOfSize(12)
dim m as new NSFontManagerMBS

// shows 2 which is m.NSBoldFontMask
MsgBox str(m.traitsOfFont(n))

Font: The font whose traits are returned.
Returns the font traits, returned as a mask created by combining values listed in Constants with the bitwiseOR operation.

NSFontManagerMBS.weightOfFont(font as NSFontMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a rough numeric measure the weight of the given font.
Example
dim n as NSFontMBS = NSFontMBS.boldSystemFontOfSize(12)
dim m as new NSFontManagerMBS

MsgBox str(m.weightOfFont(n))

Font: The font whose weight is returned.

A rough numeric measure the weight of the given font, where 0 indicates the lightest possible weight, 5 indicates a normal or book weight, and 9 or more indicates a bold or heavier weight.

Previous items

The items on this page are in the following plugins: MBS MacCocoa Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...