# `GSFont initWithDict:filePath:error:`

*Initializer*

Creates a font from a Glyphs property-list representation with an associated file path.

## Declaration

```swift
init(dict fontDict: [String : Any], filePath: String?) throws
```

```objc
- (instancetype) initWithDict:(NSDictionary<NSString *,id> *) fontDict filePath:(NSString *) filePath error:(NSError **) error;
```

```python
initWithDict_filePath_error_(fontDict: dict[str, object], filePath: str) -> tuple[GSFont, NSError]
```

## Parameters

- `fontDict` — A dictionary produced from a Glyphs font representation.
- `filePath` — The path associated with the representation, or `nil` when it has no file location.
- `error` — On output, a pointer to an error object that describes why the method failed, or `nil` if no error occurred. If you are not interested in the error information, pass `nil` for this parameter.

## Discussion

The file path is used to resolve external resources referenced by the representation.

## See Also

### Creating a Font

- [`GSFont initWithURL:error:`](/Core/GlyphsCore/GSFont/initWithURL:error:) — Creates a font by reading a Glyphs file or package.
- [`GSFont initWithData:error:`](/Core/GlyphsCore/GSFont/initWithData:error:) — Creates a font from the contents of a Glyphs file.
- [`GSFont initWithDict:error:`](/Core/GlyphsCore/GSFont/initWithDict:error:) — Creates a font from a Glyphs property-list representation.

