<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManager/showCGGlyphs(_:positions:count:font:textMatrix:attributes:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)showCGGlyphs:positions:count:font:textMatrix:attributes:inContext:"
  },
  "title" : "showCGGlyphs(_:positions:count:font:textMatrix:attributes:in:)"
}
-->

# showCGGlyphs(_:positions:count:font:textMatrix:attributes:in:)

Renders the glyphs at the specified positions, using the specified attributes.

```
func showCGGlyphs(_ glyphs: UnsafePointer<CGGlyph>, positions: UnsafePointer<CGPoint>, count glyphCount: Int, font: NSFont, textMatrix: CGAffineTransform, attributes: [NSAttributedString.Key : Any] = [:], in CGContext: CGContext)
```

## Parameters

`glyphs`

The glyphs to draw, which may include embedded `NULL` bytes.

`positions`

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

`glyphCount`

The number of glyphs to draw.

`font`

The font to apply to the graphics state. This value can be different from the <doc://com.apple.documentation/documentation/Foundation/NSAttributedString/Key/font> 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 because Quartz overrides them with the glyph positions.

`attributes`

A dictionary of glyph attributes. For a list of possible keys and values, see [Glyph Attributes](/documentation/AppKit/glyph-attributes).

`CGContext`

A graphics context object already configured with the information in the `font`, `textMatrix`, and `attributes` parameters

## Discussion

The layout manager calls this primitive method when it is time to lay out a set of glyphs in the specified graphics context.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)