NSGlyphInfo Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.2 and later. |
| Companion guide | Font Handling |
| Declared in | NSGlyphInfo.h |
Overview
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).
Adopted Protocols
Tasks
Creating an NSGlyphInfo Object
-
+ glyphInfoWithCharacterIdentifier:collection:baseString: -
+ glyphInfoWithGlyph:forFont:baseString: -
+ glyphInfoWithGlyphName:forFont:baseString:
Getting Information About an NSGlyphInfo Object
Class Methods
glyphInfoWithCharacterIdentifier:collection:baseString:
Instantiates and returns an NSGlyphInfo object using a character identifier and a character collection.
Parameters
- cid
A character identifier.
- characterCollection
A string constant representing a character collection. Possible values for characterCollection are described in “Constants.”
- theString
The part of the attributed string the returned instance is intended to override.
Return Value
The created NSGlyphInfo object or nil if the object couldn't be created.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hglyphInfoWithGlyph:forFont:baseString:
Instantiates and returns an NSGlyphInfo object using a glyph index and a specified font.
Parameters
- glyph
The identifier of the glyph.
- font
The font object to be associated with the returned
NSGlyphInfoobject,- theString
The part of the attributed string the returned instance is intended to override.
Return Value
The created NSGlyphInfo object or nil if the object couldn't be created.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hglyphInfoWithGlyphName:forFont:baseString:
Instantiates and returns an NSGlyphInfo object using a glyph name and a specified font.
Parameters
- glyphName
The name of the glyph.
- font
The font object to be associated with the returned
NSGlyphInfoobject,- theString
The part of the attributed string the returned instance is intended to override.
Return Value
The created NSGlyphInfo object or nil if the object couldn't be created.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hInstance Methods
characterCollection
Returns an NSCharacterCollection value specifying the glyph–to–character identifier mapping of the receiver.
Discussion
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.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hcharacterIdentifier
Returns the receiver’s character identifier (CID).
Discussion
If the receiver was instantiated with a method other than glyphInfoWithCharacterIdentifier:collection:baseString:, this method returns NULL.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hglyphName
Returns the receiver’s glyph name.
Discussion
If the receiver was instantiated with a method other than glyphInfoWithGlyphName:forFont:baseString:, this method returns nil.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.hConstants
NSCharacterCollection
The 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;
Constants
NSIdentityMappingCharacterCollectionIndicates that the character identifier is equal to the glyph index.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.NSAdobeCNS1CharacterCollectionIndicates the Adobe-CNS1 mapping.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.NSAdobeGB1CharacterCollectionIndicates the Adobe-GB1 mapping.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.NSAdobeJapan1CharacterCollectionIndicates the Adobe-Japan1 mapping.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.NSAdobeJapan2CharacterCollectionIndicates the Adobe-Japan2 mapping.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.NSAdobeKorea1CharacterCollectionIndicates the Adobe-Korea1 mapping.
Available in OS X v10.2 and later.
Declared in
NSGlyphInfo.h.
Availability
- Available in OS X v10.2 and later.
Declared In
NSGlyphInfo.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-03-01)