# `GSFont importAFM:fontMaster:verticalMetrics:metrics:kerning:error:`

*Instance Method*

Imports metrics and kerning from Adobe Font Metrics data.

## Declaration

```swift
func importAFM(_ AFMString: String, fontMaster: GSFontMaster?, verticalMetrics: Bool, metrics doMetrics: Bool, kerning doKerning: Bool) throws
```

```objc
- (BOOL) importAFM:(NSString *) AFMString fontMaster:(GSFontMaster *) fontMaster verticalMetrics:(BOOL) verticalMetrics metrics:(BOOL) doMetrics kerning:(BOOL) doKerning error:(NSError **) error;
```

```python
importAFM_fontMaster_verticalMetrics_metrics_kerning_error_(AFMString: str, fontMaster: GSFontMaster, verticalMetrics: bool, doMetrics: bool, doKerning: bool) -> tuple[bool, NSError]
```

## Parameters

- `AFMString` — The AFM file contents.
- `fontMaster` — The master that receives imported metrics and kerning, or `nil` to use the first master.
- `verticalMetrics` — A Boolean value that controls whether vertical metrics are imported.
- `doMetrics` — A Boolean value that controls whether glyph sidebearings and widths are imported.
- `doKerning` — A Boolean value that controls whether kerning pairs are imported.
- `error` — On failure, an error describing the problem.

## Return Value

`YES` if the method succeeded, otherwise `NO`.

## Discussion

When no master is given, the first master is used.

## See Also

### Importing Font Data

- [`GSFont readSettingDict:`](/Core/GlyphsCore/GSFont/readSettingDict:) — Reads editor and file settings from a Glyphs property-list representation.
- [`GSFont setReadBuffer:forKey:`](/Core/GlyphsCore/GSFont/setReadBuffer:forKey:) — Stores temporary serialized data for post-read processing.
- [`GSFont postRead:`](/Core/GlyphsCore/GSFont/postRead:) — Completes the font after reading serialized data.
- [`GSFont postProcess`](/Core/GlyphsCore/GSFont/postProcess) — Completes editor-facing state after reading serialized data.

