Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

NSGlyphStorage Protocol Reference

Adopted by
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac 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

Returning Glyph Display Options

Modifying the Glyph Cache

Instance Methods

attributedString

Returns the text storage object from which the NSGlyphGenerator object procures characters for glyph generation.

- (NSAttributedString *)attributedString

Availability
Declared In
NSGlyphGenerator.h

insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:

Inserts glyphs into the glyph cache beginning at glyphIndex for length glyphs and maps them to the characters beginning at charIndex.

- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex

Discussion

This is a bulk insert method for the glyph cache.

Availability
Declared In
NSGlyphGenerator.h

layoutOptions

Returns the current layout options as defined in “Constants.”

- (NSUInteger)layoutOptions

Availability
Declared In
NSGlyphGenerator.h

setIntAttribute:value:forGlyphAtIndex:

Sets a custom attribute value for the glyph at glyphIndex. The attributeTag identifies the custom attribute, and val is its new value.

- (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex

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
Declared In
NSGlyphGenerator.h

Constants

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
NSShowControlGlyphs

Generates displayable glyphs for control characters.

Available in Mac OS X v10.3 and later.

Declared in NSGlyphGenerator.h

NSShowInvisibleGlyphs

Generates displayable glyphs for invisible characters.

Available in Mac OS X v10.3 and later.

Declared in NSGlyphGenerator.h

NSWantsBidiLevels

Generates directional formatting codes for bidirectional text.

Available in Mac OS X v10.3 and later.

Declared in NSGlyphGenerator.h

Availability
Declared In
NSGlyphGenerator.h

Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice