NSGlyphGenerator Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.3 and later.
Declared in
NSGlyphGenerator.h
Companion guides
Text System Overview
Text Layout Programming Guide

Overview

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

The nominal glyph generation pass essentially generates one glyph per character; the typesetter may later make substitutions in the glyph stream, for example, changing an acute accent glyph followed by an “e” glyph into a single acute-accented “é” glyph.

NSGlyphGenerator communicates via the NSGlyphStorage protocol. An example of a class conforming to the protocol is NSLayoutManager.

Tasks

Obtaining a Glyph Generator

Generating Glyphs

Class Methods

sharedGlyphGenerator

Returns a shared instance of NSGlyphGenerator.

+ (id)sharedGlyphGenerator
Availability
  • Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.h

Instance Methods

generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:

Generates glyphs for the specified glyph storage object (NSLayoutManager by default).

- (void)generateGlyphsForGlyphStorage:(id < NSGlyphStorage >)glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(NSUInteger *)glyphIndex characterIndex:(NSUInteger *)charIndex
Discussion

Generates glyphs for the glyph storage object specified by glyphStorage, beginning with the character at charIndex and continuing for nChars characters. The glyphIndex specifies the index of the first glyph generated.

Availability
  • Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.h