Instance Method

intAttribute(_:forGlyphAt:)

Returns the value of the attribute identified by the given attribute tag for the glyph at the given index.

Declaration

func intAttribute(_ attributeTag: Int, forGlyphAt glyphIndex: Int) -> Int

Parameters

attributeTag

The attribute whose value is returned.

glyphIndex

Index of the glyph whose attribute value is returned.

Return Value

The value of the attribute identified by attributeTag and glyphIndex.

Discussion

Subclasses that define their own custom attributes must override this method to access their own storage for the attribute values. Nonnegative tags are reserved by Apple; you can define your own attributes with negative tags and set values using setIntAttribute(_:value:forGlyphAt:).

If noncontiguous layout is not enabled, this method causes generation of all glyphs up to and including glyphIndex. This method is primarily for the use of the glyph generator and typesetter.

See Also

Deprecated

attributedString

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

func invalidateGlyphs(onLayoutInvalidationForGlyphRange: NSRange)

Specifies explicitly when portions of the glyph stream depend on layout.

Deprecated
func invalidateLayout(forCharacterRange: NSRange, isSoft: Bool, actualCharacterRange: NSRangePointer?)

Invalidates the layout information for the glyphs mapped to the given range of characters.

Deprecated
func textStorage(NSTextStorage, edited: Int, range: NSRange, changeInLength: Int, invalidatedRange: NSRange)

Invalidates glyph and layout information for a portion of the text in the given text storage object.

Deprecated
func insertGlyph(NSGlyph, atGlyphIndex: Int, characterIndex: Int)

Inserts a single glyph into the glyph stream at the given index and maps it to the character at the given character index.

Deprecated
func glyph(at: Int) -> CGGlyph

Returns the glyph at glyphIndex.

Deprecated
func glyph(at: Int, isValidIndex: UnsafeMutablePointer<ObjCBool>?) -> CGGlyph

If the given index is valid, returns the glyph at that location and optionally returns a flag indicating whether the requested index is in range.

Deprecated
func replaceGlyph(at: Int, withGlyph: NSGlyph)

Replaces the glyph at the given index with a new glyph.

Deprecated
func getGlyphs(UnsafeMutablePointer<NSGlyph>?, range: NSRange) -> Int

Fills the passed-in buffer with a sequence of glyphs

Deprecated
func deleteGlyphs(in: NSRange)

Deletes the glyphs in the given range from the receiver’s glyph store.

Deprecated
func setCharacterIndex(Int, forGlyphAt: Int)

Sets the index of the character corresponding to the glyph at the given glyph index.

Deprecated
func rectArray(forCharacterRange: NSRange, withinSelectedCharacterRange: NSRange, in: NSTextContainer, rectCount: UnsafeMutablePointer<Int>) -> NSRectArray?

Returns an array of rectangles and, by reference, the number of such rectangles, that define the region in the given container enclosing the given character range.

Deprecated
func rectArray(forGlyphRange: NSRange, withinSelectedGlyphRange: NSRange, in: NSTextContainer, rectCount: UnsafeMutablePointer<Int>) -> NSRectArray?

Returns an array of rectangles and, by reference, the number of such rectangles, that define the region in the given container enclosing the given glyph range.

Deprecated
layoutOptions

The layout manager’s current layout options.

var usesScreenFonts: Bool

A Boolean that controls using screen fonts to calculate layout and display text.

Deprecated
func substituteFont(for: NSFont) -> NSFont

Returns a screen font suitable for use in place of the given font, if one is available.

Deprecated