# `GSGlyph nextLayerId:layerPos:onAxis:direction:`

*Instance Method*

Finds the nearest font master in one direction along an axis while keeping the other axis coordinates fixed.

## Declaration

```objc
- (NSString *) nextLayerId:(CGFloat *) layerAxisLocation layerPos:(CGFloat *) masterPos onAxis:(NSInteger) axisIdx direction:(int) direction;
```

```python
nextLayerId_layerPos_onAxis_direction_(layerAxisLocation: float, masterPos: float, axisIdx: int, direction: int) -> str
```

## Parameters

- `layerAxisLocation` — A buffer containing one internal coordinate for each font axis, in font axis order.
- `masterPos` — On return, the coordinate of the matching font master on the selected axis when a match is found.
- `axisIdx` — The index of the axis along which to search.
- `direction` — A nonzero value whose sign selects greater or smaller coordinates.

## Return Value

The matching font master identifier, or `nil` when no font master exists in that direction.

## See Also

### Interpolation

- [`GSGlyph interpolate:masters:error:`](/Core/GlyphsCore/GSGlyph/interpolate:masters:error:) — A detached layer formed by applying interpolation coefficients to compatible source layers.
- [`GSGlyph interpolateSmartLayer:instance:scale:targetGlyph:`](/Core/GlyphsCore/GSGlyph/interpolateSmartLayer:instance:scale:targetGlyph:) — Adds the corresponding interpolated Smart Component layers to a target glyph.
- [`GSGlyph replaceLayersWithInterpolation:error:`](/Core/GlyphsCore/GSGlyph/replaceLayersWithInterpolation:error:) — Replaces layer contents with interpolation from the remaining layers in each layer group.

