# `GSFont cleanUpKerningForDirection:`

*Instance Method*

Removes kerning pairs that reference missing glyphs or unused groups.

## Declaration

```swift
func cleanUpKerning(for direction: GSWritingDirection)
```

```objc
- (void) cleanUpKerningForDirection:(GSWritingDirection) direction;
```

```python
cleanUpKerningForDirection_(direction: GSWritingDirection)
```

## See Also

### Kerning Maintenance

- [`GSFont compressKerningForDirection:`](/Core/GlyphsCore/GSFont/compressKerningForDirection:) — Converts redundant glyph kerning to group kerning for a writing direction.
- [`GSFont sortKerning`](/Core/GlyphsCore/GSFont/sortKerning) — Sorts the kerning dictionaries into font order.
- [`GSFont replaceKey:forMasterIds:leftKey:rightKey:side:writingDirection:`](/Core/GlyphsCore/GSFont/replaceKey:forMasterIds:leftKey:rightKey:side:writingDirection:) — Replaces a kerning key in selected masters and writing direction.
- [`GSFont migrateRTLKerning`](/Core/GlyphsCore/GSFont/migrateRTLKerning) — Moves right-to-left kerning from left-to-right kerning data to right-to-left kerning data.
- [`GSFont migrateRTLKerningDict:doClasses:`](/Core/GlyphsCore/GSFont/migrateRTLKerningDict:doClasses:) — Returns migrated right-to-left kerning data from a kerning dictionary.
- [`GSFont backportRTLKerning`](/Core/GlyphsCore/GSFont/backportRTLKerning) — Returns right-to-left kerning converted back into left-to-right kerning data.
- [`GSFont convertKerning:`](/Core/GlyphsCore/GSFont/convertKerning:) — Converts imported kerning from glyph names to glyph identifiers.

