Platforms to show: All Mac Windows Linux Cross-Platform
NSFontManagerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacCocoa Plugin | 9.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
It records the currently selected font, updates the Font panel and Font menu to reflect the selected font, initiates font changes, and converts fonts in response to requests from text-bearing objects. In a more prosaic role, NSFontManager can be queried for the fonts available to the application and for the particular attributes of a font, such as whether it's condensed or extended.
As of Mac OS X version 10.3, font collections are managed by NSFontManager.
- 2 properties
- 30 methods
- method addCollection(collectionName as String, Options as Integer = 0) as Boolean
- method addFontDescriptorsToCollection(descriptors() as NSFontDescriptorMBS, collectionName as String)
- method availableFontFamilies as string()
- method availableFontNamesMatchingFontDescriptor(descriptor as NSFontDescriptorMBS) as String()
- method availableFontNamesWithTraits(traits as Integer) as string()
- method availableFonts as string()
- method availableMembersOfFontFamily(FontFamily as string) as Variant()
- method collectionNames as string()
- method Constructor
- method convertAttributes(dic as dictionary) as dictionary
- method convertFont(font as NSFontMBS) as NSFontMBS
- method convertFontToFace(font as NSFontMBS, face as string) as NSFontMBS
- method convertFontToFamily(font as NSFontMBS, family as string) as NSFontMBS
- method convertFontToHaveTrait(font as NSFontMBS, trait as Integer) as NSFontMBS
- method convertFontToNotHaveTrait(font as NSFontMBS, trait as Integer) as NSFontMBS
- method convertFontToSize(font as NSFontMBS, size as Double) as NSFontMBS
- method convertFontTraits(traits as Integer) as Integer
- method convertWeightOfFont(font as NSFontMBS, up as boolean) as NSFontMBS
- method fontDescriptorsInCollection(collectionName as String) as NSFontDescriptorMBS()
- method fontHasTraits(fontName as string, Traits as Integer) as boolean
- method isMultiple as boolean
- method orderFrontFontPanel
- method orderFrontStylesPanel
- method removeCollection(collectionName as String) as Boolean
- method removeFontDescriptorFromCollection(descriptor as NSFontDescriptorMBS, collectionName as String)
- method selectedFont as NSFontMBS
- method setSelectedAttributes(dic as dictionary, isMultiple as boolean)
- method setSelectedFont(font as NSFontMBS, isMultiple as boolean)
- method traitsOfFont(font as NSFontMBS) as Integer
- method weightOfFont(font as NSFontMBS) as Integer
- shared method sharedFontManager as NSFontManagerMBS
- 21 constants
Constants
Constant | Value | Description |
---|---|---|
NSAddTraitFontAction | 2 |
One of the constants for use with modifyFont method.
Converts the font to have an additional trait using convertFonttoHaveTrait. |
NSBoldFontMask | 2 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a bold font. Example |
NSCompressedFontMask | &h00000200 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a compressed font. |
NSCondensedFontMask | &h00000040 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a condensed font. |
NSExpandedFontMask | &h00000020 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies an expanded font. |
NSFixedPitchFontMask | &h00000400 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a fixed pitch font. |
NSFontCollectionApplicationOnlyMask | 1 |
One of the constants for options accepted by addCollection.
akes the collection available only to the application. This option is not yet implemented. |
NSHeavierFontAction | 5 |
One of the constants for use with modifyFont method.
Converts the font to a heavier weight using convertWeightofFont. |
NSItalicFontMask | 1 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies an italic font. |
NSLighterFontAction | 6 |
One of the constants for use with modifyFont method.
Converts the font to a lighter weight using convertWeightofFont. |
NSNarrowFontMask | &h00000010 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a narrow font. |
NSNoFontChangeAction | 0 |
One of the constants for use with modifyFont method.
No action; the font is returned unchanged. |
NSNonStandardCharacterSetFontMask | 8 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a font that uses a non-standard character set. |
NSPosterFontMask | &h00000100 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a poster-style font. |
NSRemoveTraitFontAction | 7 |
One of the constants for use with modifyFont method.
Converts the font to remove a trait using convertFonttoNotHaveTrait. |
NSSizeDownFontAction | 4 |
One of the constants for use with modifyFont method.
Converts the font to a smaller size using convertFonttoSize. |
NSSizeUpFontAction | 3 |
One of the constants for use with modifyFont method.
Converts the font to a larger size using convertFonttoSize. |
NSSmallCapsFontMask | &h00000080 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a small-caps font. |
NSUnboldFontMask | 4 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a font that is not bold. |
NSUnitalicFontMask | &h01000000 |
One of the constants for use with mask of traits assigned to a font.
A mask that specifies a font that is not italic. |
NSViaPanelFontAction | 1 |
One of the constants for use with modifyFont method.
Converts the font according to the NSFontPanel method panelConvertFont. |
This class has no sub classes.
Some examples using this class:
- /DynaPDF/Fonts Mapping with NSFont
- /MacBase/NSFont fonts
- /MacCocoa/Font Family Members
- /MacCocoa/Font PopupMenu in Cocoa
- /MacCocoa/Fonts and Font Families
Blog Entries
- MBS Xojo Plugins, version 17.3pr5
- MBS Releases the MBS Xojo / Real Studio plug-ins in version 16.4
- MBS Xojo / Real Studio Plugins, version 16.4pr9
- MBS Xojo / Real Studio Plugins, version 15.4pr5
- MBS Xojo / Real Studio Plugins, version 13.2pr1
- MBS Real Studio Plugins, version 12.0pr6
- MBS Real Studio Plugins, version 11.3pr14
Release notes
- Version 17.3
- Added more methods for NSFontManagerMBS class.
The items on this page are in the following plugins: MBS MacCocoa Plugin.
NSFontDescriptorMBS - NSFontMBS