<!--
{
  "availability" : [
    "macOS: 10.7.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManager/showCGGlyphs(_:positions:count:font:matrix: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:matrix:attributes:inContext:"
  },
  "title" : "showCGGlyphs(_:positions:count:font:matrix:attributes:in:)"
}
-->

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

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

```
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](/documentation/AppKit/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:`](/documentation/AppKit/NSLayoutManager/showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:) method exists and this method is not overridden.

---

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)