| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in Mac OS X v10.2 and later. |
| Companion guide | |
| Declared in | NSGlyphInfo.h |
An NSGlyphInfo object represents a glyph attribute value (NSGlyphInfoAttributeName) in an attributed string. NSGlyphInfo allows you to override a font’s specified mapping from Unicode to the glyph ID. Overriding the mapping allows you to specify a variant glyph for a given character if the font contains multiple variations for that character or to specify a glyph that doesn’t have a standard mapping (such as some ligature glyphs).
+ glyphInfoWithCharacterIdentifier:collection:baseString:
+ glyphInfoWithGlyph:forFont:baseString:
+ glyphInfoWithGlyphName:forFont:baseString:
Instantiates and returns an NSGlyphInfo object using a character identifier and a character collection.
+ (NSGlyphInfo *)glyphInfoWithCharacterIdentifier:(NSUInteger)cid collection:(NSCharacterCollection)characterCollection baseString:(NSString *)theString
A character identifier.
A string constant representing a character collection. Possible values for characterCollection are described in “Constants.”
The part of the attributed string the returned instance is intended to override.
The created NSGlyphInfo object or nil if the object couldn't be created.
NSGlyphInfo.hInstantiates and returns an NSGlyphInfo object using a glyph index and a specified font.
+ (NSGlyphInfo *)glyphInfoWithGlyph:(NSGlyph)glyph forFont:(NSFont *)font baseString:(NSString *)theString
The identifier of the glyph.
The font object to be associated with the returned NSGlyphInfo object,
The part of the attributed string the returned instance is intended to override.
The created NSGlyphInfo object or nil if the object couldn't be created.
NSGlyphInfo.hInstantiates and returns an NSGlyphInfo object using a glyph name and a specified font.
+ (NSGlyphInfo *)glyphInfoWithGlyphName:(NSString *)glyphName forFont:(NSFont *)font baseString:(NSString *)theString
The name of the glyph.
The font object to be associated with the returned NSGlyphInfo object,
The part of the attributed string the returned instance is intended to override.
The created NSGlyphInfo object or nil if the object couldn't be created.
NSGlyphInfo.hReturns an NSCharacterCollection value specifying the glyph–to–character identifier mapping of the receiver.
- (NSCharacterCollection)characterCollection
This method returns NSIdentityMappingCharacterCollection if the receiver was instantiated with either an NSGlyph identifier or a glyph name. It returns other possible values if the receiver was instantiated using glyphInfoWithCharacterIdentifier:collection:baseString:. These constants are described in NSCharacterCollection.
NSGlyphInfo.hReturns the receiver’s character identifier (CID).
- (NSUInteger)characterIdentifier
If the receiver was instantiated with a method other than glyphInfoWithCharacterIdentifier:collection:baseString:, this method returns NULL.
NSGlyphInfo.hReturns the receiver’s glyph name.
- (NSString *)glyphName
If the receiver was instantiated with a method other than glyphInfoWithGlyphName:forFont:baseString:, this method returns nil.
NSGlyphInfo.hThe following values specify the mapping of character identifiers to glyphs, and are returned by characterCollection.
typedef enum {
NSIdentityMappingCharacterCollection = 0,
NSAdobeCNS1CharacterCollection = 1,
NSAdobeGB1CharacterCollection = 2,
NSAdobeJapan1CharacterCollection = 3,
NSAdobeJapan2CharacterCollection = 4,
NSAdobeKorea1CharacterCollection = 5,
} NSCharacterCollection;
NSIdentityMappingCharacterCollectionIndicates that the character identifier is equal to the glyph index.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSAdobeCNS1CharacterCollectionIndicates the Adobe-CNS1 mapping.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSAdobeGB1CharacterCollectionIndicates the Adobe-GB1 mapping.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSAdobeJapan1CharacterCollectionIndicates the Adobe-Japan1 mapping.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSAdobeJapan2CharacterCollectionIndicates the Adobe-Japan2 mapping.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSAdobeKorea1CharacterCollectionIndicates the Adobe-Korea1 mapping.
Available in Mac OS X v10.2 and later.
Declared in NSGlyphInfo.h.
NSGlyphInfo.hLast updated: 2007-03-01