Class

NSGlyphInfo

A glyph attribute in an attributed string.

Declaration

@interface NSGlyphInfo : NSObject

Overview

Glyphs are the graphic representations of characters, stored in a font, that the text system draws on a display or printed page. Before text can be laid out, the layout manager (NSLayoutManager) generates a stream of glyphs, using the character and font information specified by the attributed string and contained in the font file. NSGlyphInfo represents a glyph attribute value (NSGlyphInfoAttributeName) in an attributed string (NSAttributedString) and provides a means to override the standard glyph generation process and substitute a specified glyph over the attribute’s range.

Glyph attributes are integer values that the layout manager uses to denote special handling for particular glyphs during rendering. NSGlyphInfo enables you to override a font’s built-in mapping from a Unicode character code to a corresponding 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).

Topics

Creating a Glyph Info Object

+ glyphInfoWithCGGlyph:forFont:baseString:

Creates a glyph info object from the specified glyph identifier and font informaton.

Getting Information About an NSGlyphInfo Object

baseString

The string containing the character represented by the glyph.

glyphID

The glyph identifier, specified as the index into the internal glyph table of the font.

Deprecated

+ glyphInfoWithCharacterIdentifier:collection:baseString:

Instantiates and returns an NSGlyphInfo object using a character identifier and a character collection.

Deprecated
+ glyphInfoWithGlyph:forFont:baseString:

Instantiates and returns a glyph information object using a glyph index and a specified font.

Deprecated
+ glyphInfoWithGlyphName:forFont:baseString:

Instantiates and returns a glyph information object using a glyph name and a specified font.

Deprecated
characterIdentifier

The receiver’s character identifier (CID).

Deprecated
characterCollection

A value specifying the glyph–to–character identifier mapping of the receiver.

Deprecated
glyphName

The receiver’s glyph name.

Deprecated
NSCharacterCollection

Values that map character identifiers to glyphs.

Relationships

Inherits From

See Also

Glyphs

NSGlyph

The type used to specify glyphs.

NSGlyphStorage

A set of methods that a glyph storage object must implement to interact properly with NSGlyphGenerator.

NSGlyphGenerator

An object that performs the initial, nominal glyph generation phase in the layout process.

Glyph Attributes

Attributes that are used only inside the glyph generation machinery, but must also be shared between components.

Deprecated
NSConvertGlyphsToPackedGlyphs

Prepares a set of glyphs for processing by character-based routines.

Deprecated