Platforms to show: All Mac Windows Linux Cross-Platform
NSFontDescriptorMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
NSFontDescriptor objects provide a mechanism to describe a font with a dictionary of attributes. This font descriptor can be used later to create or modify an NSFont object. Mac OS X v10.4 and later provides a font matching capability, so that you can partially describe a font by creating a font descriptor with, for example, just a family name. You can then find all the available fonts on the system with a matching family name using matchingFontDescriptorsWithMandatoryKeys.
There are several ways to create a new NSFontDescriptor object. You can use the Constructor, fontDescriptorWithFontAttributes or fontDescriptorWithName. to create a font descriptor based on either your custom attributes dictionary or on a specific font's name and size. Alternatively you can use one of the fontDescriptor… instance methods (such as fontDescriptorWithFace) to create a modified version of an existing descriptor. The latter methods are useful if you have an existing descriptor and simply want to change one aspect.
All attributes in the attributes dictionary are optional.
- property Handle as Integer
- 18 methods
- method Constructor(AttributesDic as Dictionary)
- method copy as NSFontDescriptorMBS
- method fontAttributes as Dictionary
- method fontDescriptorByAddingAttributes(AttributesDic as Dictionary) as NSFontDescriptorMBS
- method fontDescriptorWithFace(newFace as string) as NSFontDescriptorMBS
- method fontDescriptorWithFamily(newFamily as string) as NSFontDescriptorMBS
- method fontDescriptorWithMatrix(matrix as Variant) as NSFontDescriptorMBS
- method fontDescriptorWithSize(newPointSize as Double) as NSFontDescriptorMBS
- method fontDescriptorWithSymbolicTraits(SymbolicTraits as Integer) as NSFontDescriptorMBS
- method matchingFontDescriptorsWithMandatoryKeys as NSFontDescriptorMBS()
- method matchingFontDescriptorsWithMandatoryKeys(mandatoryKeys() as string) as NSFontDescriptorMBS()
- method matchingFontDescriptorWithMandatoryKeys as NSFontDescriptorMBS
- method matchingFontDescriptorWithMandatoryKeys(mandatoryKeys() as string) as NSFontDescriptorMBS
- method matrix as Variant
- method pointSize as Double
- method postscriptName as string
- method symbolicTraits as Integer
- method variantForKey(key as string) as Variant
- 26 shared methods
- shared method fontDescriptorWithFontAttributes(AttributesDic as Dictionary) as NSFontDescriptorMBS
- shared method fontDescriptorWithName(fontName as string, matrix as Variant) as NSFontDescriptorMBS
- shared method fontDescriptorWithName(fontName as string, size as Double) as NSFontDescriptorMBS
- shared method NSFontCascadeListAttribute as string
- shared method NSFontCharacterSetAttribute as string
- shared method NSFontColorAttribute as string
- shared method NSFontFaceAttribute as string
- shared method NSFontFamilyAttribute as string
- shared method NSFontFeatureSelectorIdentifierKey as string
- shared method NSFontFeatureTypeIdentifierKey as string
- shared method NSFontFixedAdvanceAttribute as string
- shared method NSFontMatrixAttribute as string
- shared method NSFontNameAttribute as string
- shared method NSFontSizeAttribute as string
- shared method NSFontSlantTrait as string
- shared method NSFontSymbolicTrait as string
- shared method NSFontTraitsAttribute as string
- shared method NSFontVariationAttribute as string
- shared method NSFontVariationAxisDefaultValueKey as string
- shared method NSFontVariationAxisIdentifierKey as string
- shared method NSFontVariationAxisMaximumValueKey as string
- shared method NSFontVariationAxisMinimumValueKey as string
- shared method NSFontVariationAxisNameKey as string
- shared method NSFontVisibleNameAttribute as string
- shared method NSFontWeightTrait as string
- shared method NSFontWidthTrait as string
- 19 constants
Constants
Constant | Value | Description |
---|---|---|
NSFontFamilyClassMask | &hF0000000 |
The font family class mask used to access NSFontFamilyClass values.
Available in Mac OS X v10.4 and later. This constant is used to access NSFontFamilyClass values in the upper four bits of NSFontSymbolicTraits. |
Typeface Constants
Constant | Value | Description |
---|---|---|
NSFontBoldTrait | 2 |
The font's typestyle is boldface. Available in Mac OS X v10.4 and later. |
NSFontCondensedTrait | 64 |
The font's typestyle is condensed. Expanded and condensed traits are mutually exclusive. Available in Mac OS X v10.4 and later. |
NSFontExpandedTrait | 32 |
The font's typestyle is expanded. Expanded and condensed traits are mutually exclusive. Available in Mac OS X v10.4 and later. |
NSFontItalicTrait | 1 |
The font's typestyle is italic. Available in Mac OS X v10.4 and later. |
NSFontMonoSpaceTrait | 1024 |
The font uses fixed-pitch glyphs if available. The font may have multiple glyph advances (many CJK glyphs contain two spaces). Available in Mac OS X v10.4 and later. Example |
NSFontUIOptimizedTrait | 4096 |
The font synthesizes appropriate attributes for user interface rendering, such as control titles, if necessary. Available in Mac OS X v10.4 and later. |
NSFontVerticalTrait | 2048 |
The font uses vertical glyph variants and metrics. Available in Mac OS X v10.4 and later. |
Font Family Class Constants
Constant | Value | Description |
---|---|---|
NSFontClarendonSerifsClass | &h40000000 |
The font's style is a variation of the Oldstyle Serifs and the Transitional Serifs. Available in Mac OS X v10.4 and later. |
NSFontFreeformSerifsClass | &h70000000 |
The font's style includes serifs, but it expresses a design freedom that does not generally fit within the other serif design classifications. Available in Mac OS X v10.4 and later. |
NSFontModernSerifsClass | &h30000000 |
The font's style is based on the Latin printing style of the 20th century. Available in Mac OS X v10.4 and later. |
NSFontOldStyleSerifsClass | &h10000000 |
The font's style is based on the Latin printing style of the 15th to 17th century. Available in Mac OS X v10.4 and later. |
NSFontOrnamentalsClass | &h90000000 |
The font's style includes highly decorated or stylized character shapes such as those typically used in headlines. Available in Mac OS X v10.4 and later. |
NSFontSansSerifClass | &h80000000 |
The font's style includes most basic letter forms (excluding Scripts and Ornamentals) that do not have serifs on the strokes. Available in Mac OS X v10.4 and later. |
NSFontScriptsClass | &hA0000000 |
The font's style is among those typefaces designed to simulate handwriting. Available in Mac OS X v10.4 and later. |
NSFontSlabSerifsClass | &h50000000 |
The font's style is characterized by serifs with a square transition between the strokes and the serifs (no brackets). Available in Mac OS X v10.4 and later. |
NSFontSymbolicClass | &hC0000000 | The font's style is generally design independent, making it suitable for special characters (icons, dingbats, technical symbols, and so on) that may be used equally well with any font. more |
NSFontTransitionalSerifsClass | &h20000000 |
The font's style is based on the Latin printing style of the 18th to 19th century. Available in Mac OS X v10.4 and later. |
NSFontUnknownClass | 0 |
The font has no design classification. Available in Mac OS X v10.4 and later. |
This class has no sub classes.
Some methods using this class:
- NSFontManagerMBS.addFontDescriptorsToCollection(descriptors() as NSFontDescriptorMBS, collectionName as String)
- NSFontManagerMBS.availableFontNamesMatchingFontDescriptor(descriptor as NSFontDescriptorMBS) as String()
- NSFontManagerMBS.fontDescriptorsInCollection(collectionName as String) as NSFontDescriptorMBS()
- NSFontManagerMBS.removeFontDescriptorFromCollection(descriptor as NSFontDescriptorMBS, collectionName as String)
- NSFontMBS.fontDescriptor as NSFontDescriptorMBS
- NSFontMBS.fontWithDescriptor(fontDescriptor as NSFontDescriptorMBS, fontSize as Double) as NSFontMBS
- NSFontMBS.fontWithDescriptor(fontDescriptor as NSFontDescriptorMBS, TextTransform as Variant) as NSFontMBS
Blog Entries
The items on this page are in the following plugins: MBS MacBase Plugin.
NSFileWrapperMBS - NSFontManagerMBS