# GSLayer Attributes

*API Collection*

Additional values stored for a layer.

## Overview

Attributes describe layer behavior and special layer formats. Use user data for persistent values and temporary data for values that are not stored in the source file.

Attribute and user data values must support property-list encoding.

Use unique, namespaced keys for user-defined values. Keys prefixed with `GS` are reserved by Glyphs.

## Topics

### Attributes

- [`GSLayer.attributes`](/Core/GlyphsCore/GSLayer/attributes) — Values that configure layer behavior and special layer formats.
- [`GSLayer countOfAttributes`](/Core/GlyphsCore/GSLayer/countOfAttributes) — The number of attributes.
- [`GSLayer attributeForKey:`](/Core/GlyphsCore/GSLayer/attributeForKey:) — The value for an attribute key, or `nil` if no value is set.
- [`GSLayer setAttributesFast:`](/Core/GlyphsCore/GSLayer/setAttributesFast:) — Replaces all attributes without registering undo or notifying the glyph.
- [`GSLayer setAttribute:forKey:`](/Core/GlyphsCore/GSLayer/setAttribute:forKey:) — Sets or removes an attribute.
- [`GSLayer setAttributeFast:forKey:`](/Core/GlyphsCore/GSLayer/setAttributeFast:forKey:) — Sets an attribute without registering undo or notifying the glyph.
- [`GSLayer removeAttributeForKey:`](/Core/GlyphsCore/GSLayer/removeAttributeForKey:) — Removes an attribute.

### Temporary Data

- [`GSLayer.tempData`](/Core/GlyphsCore/GSLayer/tempData) — Values associated with the layer for transient use.
- [`GSLayer setTempData:forKey:`](/Core/GlyphsCore/GSLayer/setTempData:forKey:) — Sets or removes a temporary value.
- [`GSLayer tempDataForKey:`](/Core/GlyphsCore/GSLayer/tempDataForKey:) — The temporary value for a key, or `nil` if no value is set.

### User Data

- [`GSLayer.userData`](/Core/GlyphsCore/GSLayer/userData) — Persistent values associated with the layer by API clients.
- [`GSLayer userDataForKey:`](/Core/GlyphsCore/GSLayer/userDataForKey:) — The user-data value for a key, or `nil` if no value is set.
- [`GSLayer setUserData:forKey:`](/Core/GlyphsCore/GSLayer/setUserData:forKey:) — Sets or removes a persistent user-data value.
- [`GSLayer removeUserDataForKey:`](/Core/GlyphsCore/GSLayer/removeUserDataForKey:) — Removes a user-data value.

## See Also

- [GSLayer Kind](/Core/GlyphsCore/GSLayer-Kind) — The different roles that a layer can serve.
- [GSLayer Shapes](/Core/GlyphsCore/GSLayer-Shapes) — The paths and components that form the outline of a layer.
- [GSLayer Bounds](/Core/GlyphsCore/GSLayer-Bounds) — Bounding rectangles of outlines, selections, and metrics.
- [GSLayer Metrics](/Core/GlyphsCore/GSLayer-Metrics) — Side bearings, baseline offsets, layer box, and metrics keys.
- [GSLayer Grid](/Core/GlyphsCore/GSLayer-Grid) — Setting for rounding coordinates on a layer.
- [GSLayer Background](/Core/GlyphsCore/GSLayer-Background) — Background content and reference images associated with a layer.
- [GSLayer Anchors](/Core/GlyphsCore/GSLayer-Anchors) — Named attachment points on a layer.
- [GSLayer Hints](/Core/GlyphsCore/GSLayer-Hints) — Manual and generated hint data on a layer.
- [GSLayer Guides](/Core/GlyphsCore/GSLayer-Guides) — Layer-local guides used while editing outlines.
- [GSLayer Kerning](/Core/GlyphsCore/GSLayer-Kerning) — Spacing adjustment between specific layers.
- [GSLayer Annotations](/Core/GlyphsCore/GSLayer-Annotations) — Layer-local notes displayed with a glyph.
- [GSLayer Interpolation](/Core/GlyphsCore/GSLayer-Interpolation) — Axis coordinates and rules that place layers in a design space.
- [GSLayer Color](/Core/GlyphsCore/GSLayer-Color) — Colors used to draw a layer.
- [GSLayer Inspection](/Core/GlyphsCore/GSLayer-Inspection) — Intersections between layer outlines and line segments.
- [GSLayer Editing](/Core/GlyphsCore/GSLayer-Editing) — Operations for modifying outlines and other layer content.

