Instance Method

showCGGlyphs(_:positions:count:font:matrix:attributes:in:)

Renders the glyphs at the specified positions and attributes into the graphics context.

Declaration

iOS, tvOS
func showCGGlyphs(_ glyphs: UnsafePointer<CGGlyph>, positions: UnsafePointer<CGPoint>, count glyphCount: Int, font: UIFont, matrix textMatrix: CGAffineTransform, attributes: [NSAttributedString.Key : Any] = [:], in graphicsContext: CGContext)
macOS
func showCGGlyphs(_ glyphs: UnsafePointer<CGGlyph>, positions: UnsafePointer<NSPoint>, count glyphCount: Int, font: NSFont, matrix textMatrix: AffineTransform, attributes: [NSAttributedString.Key : Any] = [:], in graphicsContext: NSGraphicsContext)

Parameters

glyphs

The glyphs to draw; may contain embedded NULL bytes.

positions

The positions at which to draw the glyphs. In the user space coordinate system.

glyphCount

The number of glyphs.

font

The font applied to the graphics state. This value can be different from the NSFontAttributeName value in the attributes argument because of various font substitutions that the system automatically executes.

textMatrix

The affine transform mapping the text space coordinate system to the user space coordinate system. The tx and ty components of textMatrix are ignored since Quartz overrides them with the glyph positions.

attributes

A dictionary of glyph attributes. See Glyph Attributes for supported keys and values.

graphicsContext

If non-nil, graphicsContext is already configured according to the text attributes arguments: font, textMatrix, and attributes.

Discussion

NSLayoutManager invokes this primitive method unless an override implementation of the deprecated showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment: method exists and this method is not overridden.

See Also

Methods

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 the specified index.

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

Returns the glyph at a specified index, and optionally returns a flag indicating whether the requested index is valid.

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 intAttribute(Int, forGlyphAt: Int) -> Int

Returns the value of the attribute identified by the given attribute tag for the glyph at the given 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
func substituteFont(for: NSFont) -> NSFont

Replaces the specified font with a suitable screen font if one is available.

Deprecated