# `GSFont preWrite:`

*Instance Method*

Prepares the font before writing.

## Declaration

```swift
func preWrite() throws
```

```objc
- (BOOL) preWrite:(NSError **) error;
```

```python
preWrite_() -> tuple[bool, NSError]
```

## Parameters

- `error` — On failure, an error describing the problem.

## Return Value

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

## Discussion

Call this before using low-level serialization when pre-write validation or normalization is required.

## See Also

### Saving

- [`GSFont saveToURL:type:error:`](/Core/GlyphsCore/GSFont/saveToURL:type:error:) — Saves the font to a file or package.
- [`GSFont saveToURL:type:format:context:error:`](/Core/GlyphsCore/GSFont/saveToURL:type:format:context:error:) — Saves the font to a file or package using an explicit format and save context.
- [`GSFont saveContextForURL:type:`](/Core/GlyphsCore/GSFont/saveContextForURL:type:) — Creates a save context for a destination and package type.
- [`GSFont propertyListValueFormat:error:`](/Core/GlyphsCore/GSFont/propertyListValueFormat:error:) — A property-list representation of the font.
- [`GSFont writeSettingsDict:`](/Core/GlyphsCore/GSFont/writeSettingsDict:) — A property-list representation of editor and file settings.

