---
title: "setIntAttribute(_:value:forGlyphAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsglyphstorage/setintattribute(_:value:forglyphat:)"
---

# setIntAttribute(_:value:forGlyphAt:)

Sets a custom attribute value for a given glyph.

## Declaration

```swift
func setIntAttribute(_ attributeTag: Int, value val: Int, forGlyphAt glyphIndex: Int)
```

## Parameters

- `attributeTag`: The custom attribute.
- `val`: The new attribute value.
- `glyphIndex`: Index of the glyph whose attribute is set.

## Discussion

Discussion Custom attributes are glyph attributes such as NSGlyphInscription or attributes defined by subclasses. Subclasses that define their own custom attributes must override this method and provide their own storage for the attribute values. Nonnegative tags are reserved; you can define your own attributes with negative tags and set values using this method.

## See Also

### Modifying the glyph cache

- [insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)](appkit/nsglyphstorage/insertglyphs(_:length:forstartingglyphat:characterindex:).md)
