<!--
{
  "availability" : [
    "macOS: -",
    "swift: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGlyphInfo/init(glyph:forFont:baseString:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGlyphInfo(cm)glyphInfoWithGlyph:forFont:baseString:::SYNTHESIZED::c:objc(cs)NSGlyphInfo"
  },
  "title" : "init(glyph:forFont:baseString:)"
}
-->

# init(glyph:forFont:baseString:)

Instantiates and returns a glyph information object using a glyph index and a specified font.

```
init?(glyph: NSGlyph, forFont font: NSFont, baseString string: String)
```

## Parameters

`glyph`

The identifier of the glyph.

`font`

The font object to be associated with the returned `NSGlyphInfo` object,

`string`

The part of the attributed string the returned instance is intended to override.

## Return Value

The created `NSGlyphInfo` object or `nil` if the object couldn’t be created.

## Discussion

---

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)