# `GSFont initWithURL:error:`

*Initializer*

Creates a font by reading a Glyphs file or package.

## Declaration

```swift
init(url fileURL: URL) throws
```

```objc
- (instancetype) initWithURL:(NSURL *) fileURL error:(NSError **) error;
```

```python
initWithURL_error_(fileURL: NSURL) -> tuple[GSFont, NSError]
```

## Parameters

- `fileURL` — The location of a Glyphs file or package.
- `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

Returns `nil` when the file does not exist or its contents cannot be read.

## See Also

### Creating a Font

- [`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.
- [`GSFont initWithDict:filePath:error:`](/Core/GlyphsCore/GSFont/initWithDict:filePath:error:) — Creates a font from a Glyphs property-list representation with an associated file path.

