# `GSFont.metrics`

*Instance Property*

Font-wide metrics definitions.

## Declaration

```swift
var metrics: [GSMetric]? { get set }
```

```objc
@property (nonatomic, strong) NSArray<GSMetric *> * metrics;
```

[See also `metrics` in the Python API](https://docu.glyphsapp.com/#GSFont.metrics)

```python
pyobjc_instanceMethods.metrics() -> list[GSMetric]
pyobjc_instanceMethods.setMetrics_(metrics: list[GSMetric])
```

## Discussion

Each metric defines a shared measurement such as ascender, x-height, baseline, or italic angle. The values for these definitions are stored on each master.

## See Also

### Metrics

- [`GSFont.metricsContent`](/Core/GlyphsCore/GSFont/metricsContent) — KVO marker for changes that affect metrics.
- [`GSFont countOfMetrics`](/Core/GlyphsCore/GSFont/countOfMetrics) — Returns the number of font-wide metrics definitions.
- [`GSFont objectInMetricsAtIndex:`](/Core/GlyphsCore/GSFont/objectInMetricsAtIndex:) — Returns the metric at an index.
- [`GSFont objectInMetricsWithName:`](/Core/GlyphsCore/GSFont/objectInMetricsWithName:) — Returns the first metric with a name.
- [`GSFont objectInMetricsWithType:withName:`](/Core/GlyphsCore/GSFont/objectInMetricsWithType:withName:) — Returns the first metric with a type and name.
- [`GSFont objectInMetricsWithType:withName:filter:`](/Core/GlyphsCore/GSFont/objectInMetricsWithType:withName:filter:) — Returns the first metric with a type, name, and filter.
- [`GSFont addMetric:`](/Core/GlyphsCore/GSFont/addMetric:) — Adds a metric definition to the font.
- [`GSFont removeObjectFromMetrics:`](/Core/GlyphsCore/GSFont/removeObjectFromMetrics:) — Removes a metric definition from the font.
- [`GSFont sortMetrics`](/Core/GlyphsCore/GSFont/sortMetrics) — Sorts metric definitions by filter and position.
- [`GSFont generateMetrics:`](/Core/GlyphsCore/GSFont/generateMetrics:) — Creates metrics from dictionary descriptions.
- [`GSFont updateMetrics`](/Core/GlyphsCore/GSFont/updateMetrics) — Marks layer metrics for recalculation.
- [`GSFont calculateDefaultWidth:`](/Core/GlyphsCore/GSFont/calculateDefaultWidth:) — Assigns default layer widths for a glyph.

