# `GSFormatVersion`

*Enumeration*

A version of the Glyphs source format.

## Declaration

```swift
enum GSFormatVersion
```

```objc
enum GSFormatVersion : uint8_t;
```

```python
GSFormatVersion
```

## Overview

The format version controls how model data is read and written. Use [`GSFormatVersion.GSFormatVersionCurrent`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersionCurrent) unless the output must remain compatible with an earlier version of Glyphs. Earlier formats cannot represent all current model data.

Versions of the Glyphs source format.

## Overview

A format version identifies the serialization rules used when reading or writing Glyphs model data. It does not describe the in-memory model or whether a font is stored as a single file or a package.

Use [`GSFormatVersion.GSFormatVersionCurrent`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersionCurrent) when backward compatibility is not required. Writing an earlier format can fail when model data requires features introduced by a newer format. Glyphs 1 and Glyphs 2 share format version 1, so there is no format version 2.

## Topics

### Format Versions

- [`GSFormatVersion.GSFormatVersion1`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersion1) — The source format used by Glyphs 1 and Glyphs 2.
- [`GSFormatVersion.GSFormatVersion3`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersion3) — The source format introduced by Glyphs 3.
- [`GSFormatVersion.GSFormatVersion4`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersion4) — The source format introduced by Glyphs 4.
- [`GSFormatVersion.GSFormatVersionCurrent`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersionCurrent) — The most recent source format supported by the framework.

### Validation

- [`GSFormatVersionValidate`](/Core/GlyphsCore/GSFormatVersionValidate) — Whether a value identifies a supported source format.
- [`GSFormatVersionValidateOrDefault`](/Core/GlyphsCore/GSFormatVersionValidateOrDefault) — A supported source format, or [`GSFormatVersion.GSFormatVersionCurrent`](/Core/GlyphsCore/GSFormatVersion/GSFormatVersionCurrent) when the value is not supported.

