# `GSLayer alignedMetricsValueForKey:`

*Type Method*

Numeric offset encoded in an aligned metrics key.

## Declaration

```swift
class func alignedMetricsValue(forKey key: String?) -> Int
```

```objc
+ (NSInteger) alignedMetricsValueForKey:(NSString *) key;
```

```python
alignedMetricsValueForKey_(key: str) -> int
```

## Discussion

Returns `0` when no offset is encoded.

## See Also

### Metrics Keys Utilities

- [`GSLayer plainMetricsKeyUI:`](/Core/GlyphsCore/GSLayer/plainMetricsKeyUI:) — Plain metrics key for display and editing.
- [`GSLayer attributedMetricsKey:fontSize:state:`](/Core/GlyphsCore/GSLayer/attributedMetricsKey:fontSize:state:) — Attributed display string for a metrics key.
- [`GSLayer metricsKeysOutOfSync`](/Core/GlyphsCore/GSLayer/metricsKeysOutOfSync) — Whether any horizontal metrics key is out of sync.
- [`GSLayer metricsKeysInvalid`](/Core/GlyphsCore/GSLayer/metricsKeysInvalid) — Whether any horizontal metrics key is invalid.
- [`GSLayer metricsLabelForSide:`](/Core/GlyphsCore/GSLayer/metricsLabelForSide:) — Localized label for a metric side.
- [`GSLayer colorForMetricsState:`](/Core/GlyphsCore/GSLayer/colorForMetricsState:) — Display color for metrics key state flags.

