Mac Developer Library

Developer

AppKit Framework Reference NSGlyphStorage Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSGlyphStorage

The NSGlyphStorage protocol defines the methods that a glyph storage object must implement in order to interact properly with NSGlyphGenerator. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.3 and later.
  • Returns the text storage object from which the NSGlyphGenerator object procures characters for glyph generation. (required)

    Declaration

    Swift

    func attributedString() -> NSAttributedString

    Objective-C

    - (NSAttributedString *)attributedString

    Return Value

    The receiver’s text storage object.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Returns the current layout options. (required)

    Declaration

    Swift

    func layoutOptions() -> Int

    Objective-C

    - (NSUInteger)layoutOptions

    Return Value

    The layout options as a bit mask, as defined in Constants.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Inserts the given glyphs into the glyph cache and maps them to the specified characters. (required)

    Declaration

    Swift

    func insertGlyphs(_ glyphs: UnsafePointer<NSGlyph>, length glyphIndex: Int, forStartingGlyphAtIndex length: Int, characterIndex charIndex: Int)

    Objective-C

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

    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.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • Sets a custom attribute value for a given glyph. (required)

    Declaration

    Swift

    func setIntAttribute(_ attributeTag: Int, value val: Int, forGlyphAtIndex glyphIndex: Int)

    Objective-C

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

    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.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.3 and later.

  • These constants describe layout options returned as a bit mask by the layoutOptions method.

    Declaration

    Swift

    var NSShowControlGlyphs: Int { get } var NSShowInvisibleGlyphs: Int { get } var NSWantsBidiLevels: Int { get }

    Objective-C

    enum { NSShowControlGlyphs = (1 << 0), NSShowInvisibleGlyphs = (1 << 1), NSWantsBidiLevels = (1 << 2) };

    Constants

    • NSShowControlGlyphs

      NSShowControlGlyphs

      Generates displayable glyphs for control characters.

      Available in OS X v10.3 and later.

    • NSShowInvisibleGlyphs

      NSShowInvisibleGlyphs

      Generates displayable glyphs for invisible characters.

      Available in OS X v10.3 and later.

    • NSWantsBidiLevels

      NSWantsBidiLevels

      Generates directional formatting codes for bidirectional text.

      Available in OS X v10.3 and later.

    Import Statement