# `PaperSize`

A paper size: ISO 216's A and B series and the US letter, legal and tabloid, written `A4`, `Letter`.

[Media and visual](types.md#media-and-visual); not ordered; since Jadpo 0.1.0.

## Make one

Pick one of its variants, `PaperSize.a0`.

`text.parse(raw, as: PaperSize)` reads one from its text; text that isn't one at all fails `malformed`, such as `A11`, `C4` or `Executive`.

## Variants

| Variant | Written |
|---|---|
| `a0` | `A0` |
| `a1` | `A1` |
| `a2` | `A2` |
| `a3` | `A3` |
| `a4` | `A4` |
| `a5` | `A5` |
| `a6` | `A6` |
| `a7` | `A7` |
| `a8` | `A8` |
| `a9` | `A9` |
| `a10` | `A10` |
| `b0` | `B0` |
| `b1` | `B1` |
| `b2` | `B2` |
| `b3` | `B3` |
| `b4` | `B4` |
| `b5` | `B5` |
| `b6` | `B6` |
| `b7` | `B7` |
| `b8` | `B8` |
| `b9` | `B9` |
| `b10` | `B10` |
| `letter` | `Letter` |
| `legal` | `Legal` |
| `tabloid` | `Tabloid` |

## Text, JSON and storage

`text.from` writes its canonical text, the one form `text.parse` reads back. JSON sends its canonical text as a string.

| Text | JSON |
|---|---|
| `A4` | `"A4"` |
| `B5` | `"B5"` |
| `Letter` | `"Letter"` |

It is stored in one column named for the field, of type `text`. `B5` is stored as `'B5'`.

## Shown to people

`text.format(value, locale:)` shows it to people in their locale.

With `locale: Locale.en_gb`:

| Value | Shown |
|---|---|
| `A4` | `A4` |
| `B5` | `B5` |
| `Letter` | `Letter` |

## Operations

It has the contract's own operations: `text.parse`, `text.from`, `text.format`, `json.read`, `json.write` and `==`. It isn't ordered, so `<` and sorting don't take it. [Every standard type meets one contract](../topics/every-standard-type-meets-one-contract.md) says how they work.
