# `GSFont countOfMetrics`

*Instance Method*

Returns the number of font-wide metrics definitions.

## Declaration

```swift
func countOfMetrics() -> UInt
```

```objc
- (NSUInteger) countOfMetrics;
```

```python
countOfMetrics() -> int
```

## See Also

### Metrics

- [`GSFont.metrics`](/Core/GlyphsCore/GSFont/metrics) — Font-wide metrics definitions.
- [`GSFont.metricsContent`](/Core/GlyphsCore/GSFont/metricsContent) — KVO marker for changes that affect metrics.
- [`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.

