| 1 |
--- |
| 2 |
title: Axis |
| 3 |
--- |
| 4 |
Represents an axis in a multiple master or variable font. |
| 5 |
* When writing to Babelfont-JSON, this class must be serialized without newlines |
| 6 |
## Axis.name |
| 7 |
|
| 8 |
* Python type: `I18NDictionary` |
| 9 |
|
| 10 |
* **Required field** |
| 11 |
|
| 12 |
The display name for this axis. *Localizable.* |
| 13 |
|
| 14 |
|
| 15 |
## Axis.tag |
| 16 |
|
| 17 |
* Python type: `str` |
| 18 |
|
| 19 |
* **Required field** |
| 20 |
|
| 21 |
The four-letter axis tag. |
| 22 |
|
| 23 |
|
| 24 |
## Axis.id |
| 25 |
|
| 26 |
* Python type: `str` |
| 27 |
|
| 28 |
An ID used to refer to this axis in the Master, |
| 29 |
Layer and Instance `location` fields. (This is allows the user to change the |
| 30 |
axis tag without the locations becoming lost.) If not provided, one will be |
| 31 |
automatically generated on import from a UUID. |
| 32 |
|
| 33 |
|
| 34 |
## Axis.min |
| 35 |
|
| 36 |
* Python type: `int` |
| 37 |
|
| 38 |
The minimum value of this axis, in user space coordinates. |
| 39 |
*If not provided, defaults to* `None`. |
| 40 |
|
| 41 |
|
| 42 |
## Axis.max |
| 43 |
|
| 44 |
* Python type: `int` |
| 45 |
|
| 46 |
The maximum value of this axis, in user space coordinates. |
| 47 |
*If not provided, defaults to* `None`. |
| 48 |
|
| 49 |
|
| 50 |
## Axis.default |
| 51 |
|
| 52 |
* Python type: `int` |
| 53 |
|
| 54 |
The default value of this axis (center of interpolation), |
| 55 |
in user space coordinates. Note that if the min/max/default values are not supplied, |
| 56 |
they are returned as `None` in the Python object, and should be computed from the |
| 57 |
master locations on export. |
| 58 |
*If not provided, defaults to* `None`. |
| 59 |
|
| 60 |
|
| 61 |
## Axis.map |
| 62 |
|
| 63 |
* Python type: `[(int, int)]` |
| 64 |
|
| 65 |
The mapping between userspace and designspace coordinates. |
| 66 |
*If not provided, defaults to* `None`. |
| 67 |
|
| 68 |
|
| 69 |
## Axis._formatspecific |
| 70 |
|
| 71 |
* Python type: `dict` |
| 72 |
|
| 73 |
|
| 74 |
Each object in Babelfont has an optional attached dictionary to allow the storage |
| 75 |
of format-specific information. Font creation software may store any additional |
| 76 |
information that they wish to have preserved on import and export under a |
| 77 |
namespaced (reverse-domain) key in this dictionary. For example, information |
| 78 |
specific to the Glyphs software should be stored under the key `com.glyphsapp`. |
| 79 |
The value stored under this key may be any data serializable in JSON; typically |
| 80 |
it will be a `dict`. |
| 81 |
|
| 82 |
Note that there is an important distinction between the Python object format |
| 83 |
of this field and the Babelfont-JSON representation. When stored to JSON, this key |
| 84 |
is exported not as `_formatspecific` but as a simple underscore (`_`). |
| 85 |
|
| 86 |
|
| 87 |
|