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
NSFontManager is the center of activity for the font conversion system.
Example
// pick some font
dim n1 as NSFontMBS = nsfontmbs.fontWithName("Book Antiqua bold", 12)
dim fm as new NSFontManagerMBS

// remove all font traits
dim n2 as NSFontMBS = fm.convertFontToNotHaveTrait(n1, fm.traitsOfFont(n1))

// show name of base font
MsgBox n2.fontName

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.

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:

Blog Entries

Release notes


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


NSFontDescriptorMBS   -   NSFontMBS


The biggest plugin in space...