NSGlyphStorage Protocol Reference
| Adopted by | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.3 and later. |
| Declared in | NSGlyphGenerator.h |
| Companion guides |
Overview
The NSGlyphStorage protocol defines the methods that a glyph storage object must implement in order to interact properly with NSGlyphGenerator.
An example of a Cocoa class conforming to the NSGlyphStorage protocol is NSLayoutManager.
Tasks
Returning Text Storage
-
– attributedStringrequired method
Returning Glyph Display Options
-
– layoutOptionsrequired method
Modifying the Glyph Cache
-
– insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:required method -
– setIntAttribute:value:forGlyphAtIndex:required method
Instance Methods
attributedString
Returns the text storage object from which the NSGlyphGenerator object procures characters for glyph generation. (required)
Return Value
The receiver’s text storage object.
Availability
- Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.hinsertGlyphs:length:forStartingGlyphAtIndex:characterIndex:
Inserts the given glyphs into the glyph cache and maps them to the specified characters. (required)
Parameters
- glyphs
The glyphs to insert.
- glyphIndex
Location in the glyph cache to begin inserting glyphs.
- length
Number of glyphs to insert.
- charIndex
Index of first character to be mapped.
Discussion
This is a bulk insert method for the glyph cache.
Availability
- Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.hlayoutOptions
Returns the current layout options. (required)
Return Value
The layout options as a bit mask, as defined in “Constants.”
Availability
- Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.hsetIntAttribute:value:forGlyphAtIndex:
Sets a custom attribute value for a given glyph. (required)
Parameters
- attributeTag
The custom attribute.
- val
The new attribute value.
- glyphIndex
Index of the glyph whose attribute is set.
Discussion
Custom attributes are glyph attributes such as NSGlyphInscription or attributes defined by subclasses. Subclasses that define their own custom attributes must override this method and provide their own storage for the attribute values. Nonnegative tags are reserved; you can define your own attributes with negative tags and set values using this method.
Availability
- Available in OS X v10.3 and later.
Declared In
NSGlyphGenerator.hConstants
Layout Options
These constants describe layout options returned as a bit mask by the layoutOptions method.
enum {
NSShowControlGlyphs = (1 << 0),
NSShowInvisibleGlyphs = (1 << 1),
NSWantsBidiLevels = (1 << 2)
};
Constants
NSShowControlGlyphsGenerates displayable glyphs for control characters.
Available in OS X v10.3 and later.
Declared in
NSGlyphGenerator.h.NSShowInvisibleGlyphsGenerates displayable glyphs for invisible characters.
Available in OS X v10.3 and later.
Declared in
NSGlyphGenerator.h.NSWantsBidiLevelsGenerates directional formatting codes for bidirectional text.
Available in OS X v10.3 and later.
Declared in
NSGlyphGenerator.h.
Declared In
NSGlyphGenerator.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-06)