Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSFontMBS class.
NSFontMBS.boldSystemFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If fontSize is 0 or negative, returns the boldface system font at the default size.
Some examples using this method:
NSFontMBS.controlContentFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
For example, in a table, the user's input uses the control content font, and the table's header uses another font. If fontSize is 0 or negative, returns the control content font at the default size.
NSFontMBS.fontWithDescriptor(fontDescriptor as NSFontDescriptorMBS, fontSize as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fontDescriptor: A font descriptor object.
fontSize: The size in points to which the font is scaled.
Returns a font object for the specified descriptor and size.
In most cases, you can simply use fontWithName to create standard scaled fonts.
Available in Mac OS X v10.4 and later.
See also:
NSFontMBS.fontWithDescriptor(fontDescriptor as NSFontDescriptorMBS, TextTransform as Variant) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
fontDescriptor: The font descriptor object describing the font to return.
textTransform: An affine transformation applied to the font. Must be a NSAffineTransformMBS object or nil!
Returns a font object for the specified name and transform.
In most cases, you can simply use fontWithName to create standard scaled fonts. If textTransform is non-nil, it has precedence over NSFontMatrixAttribute in fontDescriptor.
Available in Mac OS X v10.4 and later.
See also:
NSFontMBS.fontWithName(fontName as string, fontSize as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The fontName is a fully specified family-face name, such as Helvetica-BoldOblique or Times-Roman. The fontSize is equivalent to using a font matrix of [fontSize 0 0 fontSize 0 0] . If you use a fontSize of 0.0, this method uses the default User Font size.
Fonts created with this method automatically flip themselves in flipped views. This method is the preferred means for creating fonts.
Some examples using this method:
- /AVFoundation/Add text to video
- /MacCocoa/Font PopupMenu in Cocoa
- /MacCocoa/Print RTF via NSGraphics
- /MacCocoa/TextHeight calculation
- /MacControls/HUDPopupMenu
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/NSTextView Selection
- /MacControls/PopupMenu in Cocoa
- /PDFKit/Create Page with custom stamp annotation
- /PDFKit/Create Page with Page
NSFontMBS.labelFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the label font with the default size.
NSFontMBS.labelFontSize as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSFontMBS.menuBarFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the menu bar font with the default size.
Available in Mac OS X v10.3 and later.
NSFontMBS.menuFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the menu items font with the default size.
NSFontMBS.messageFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns this font at the default size. This method is equivalent to systemFontOfSize().
NSFontMBS.monospacedDigitSystemFontOfSize(fontSize as double, weight as double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 22.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fontSize: The desired font size specified in points. If you specify 0.0 or a negative number for this parameter, the method returns the system font at the default size.
weight: The desired weight of font lines, specified as one of the constants in NSFontWeight.
Returns a font object containing the system font with monospace digits at the specified size and weight.
The font returned by this method has monospaced digit glyphs. Glyphs for other characters and symbols may be wider or narrower than the monospaced characters. To ensure the font uses fixed spacing for all characters, apply the NSFontFixedAdvanceAttribute attribute to the any strings you render.
NSFontMBS.monospacedSystemFontOfSize(fontSize as double, weight as double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 22.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
fontSize: The desired font size specified in points. If you specify 0.0 or a negative number for this parameter, the method returns the system font at the default size.
weight: The desired weight of font lines, specified as one of the constants in NSFontWeight.
Returns a font object containing a monospace version of the system font at the specified size and weight.
Use the returned font for interface items that require monospaced glyphs. The returned font includes monospaced glyphs for the Latin characters and the symbols commonly found in source code. Glyphs for other symbols are usually wider or narrower than the monospaced characters. To ensure the font uses fixed spacing for all characters, apply the NSFontFixedAdvanceAttribute attribute to the any strings you render.
NSFontMBS.paletteFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the palette title font at the default size.
NSFontMBS.setUserFixedPitchFont(font as NSFontMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Specifying font as nil causes the default to be removed from the application domain.
NSFontMBS.setUserFont(font as NSFontMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Specifying font as nil causes the default to be removed from the application domain.
NSFontMBS.smallSystemFontSize as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSFontMBS.systemFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If fontSize is 0 or negative, returns the system font at the default size.
Some examples using this method:
- /MacCocoa/Fun with TabPanel
- /MacCocoa/NSFontPanel
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
NSFontMBS.systemFontSize as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Some examples using this method:
NSFontMBS.systemFontSizeForControlSize(controlSize as Integer) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If controlSize does not correspond to a valid NSControlSize, returns the size of the standard system font.
Available in Mac OS X v10.3 and later.
NSFontMBS.titleBarFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the title bar font at the default size. This method is equivalent to boldSystemFontOfSize.
NSFontMBS.toolTipsFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the tool tips font at the default size.
NSFontMBS.userFixedPitchFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the fixed-pitch font at the default size.
The system does not guarantee that all the glyphs in a fixed-pitch font are the same width. For example, certain Japanese fonts are dual-pitch, and other fonts may have nonspacing marks that can affect the display of other glyphs.
NSFontMBS.userFontOfSize(size as Double) as NSFontMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa | MBS MacBase Plugin | 9.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If fontSize is 0 or negative, returns the user font at the default size.
The items on this page are in the following plugins: MBS MacBase Plugin.