| 1 |
--- |
| 2 |
title: Glyph |
| 3 |
--- |
| 4 |
Glyph(name: str, production_name: Optional[str] = None, category: str = 'base', codepoints: List[int] = <factory>, layers: List[babelfont.Layer.Layer] = <factory>, exported: bool = True, direction: str = 'LTR', _formatspecific: dict = <factory>, _: dict = None) |
| 5 |
* When writing to Babelfont-JSON, this class must be serialized without newlines |
| 6 |
## Glyph.name |
| 7 |
|
| 8 |
* Python type: `str` |
| 9 |
|
| 10 |
* **Required field** |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
## Glyph.production_name |
| 16 |
|
| 17 |
* Python type: `Optional[str]` |
| 18 |
|
| 19 |
|
| 20 |
*If not provided, defaults to* `None`. |
| 21 |
|
| 22 |
|
| 23 |
## Glyph.category |
| 24 |
|
| 25 |
* Python type: `str` |
| 26 |
|
| 27 |
|
| 28 |
*If not provided, defaults to* `base`. |
| 29 |
|
| 30 |
|
| 31 |
## Glyph.codepoints |
| 32 |
|
| 33 |
* Python type: `[int]` |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
## Glyph.layers |
| 39 |
|
| 40 |
* Python type: [[`Layer`](Layer.html)] |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
## Glyph.exported |
| 46 |
|
| 47 |
* Python type: `bool` |
| 48 |
|
| 49 |
|
| 50 |
*If not provided, defaults to* `True`. |
| 51 |
|
| 52 |
|
| 53 |
## Glyph.direction |
| 54 |
|
| 55 |
* Python type: `str` |
| 56 |
|
| 57 |
|
| 58 |
*If not provided, defaults to* `LTR`. |
| 59 |
|
| 60 |
|
| 61 |
## Glyph._formatspecific |
| 62 |
|
| 63 |
* Python type: `dict` |
| 64 |
|
| 65 |
|
| 66 |
Each object in Babelfont has an optional attached dictionary to allow the storage |
| 67 |
of format-specific information. Font creation software may store any additional |
| 68 |
information that they wish to have preserved on import and export under a |
| 69 |
namespaced (reverse-domain) key in this dictionary. For example, information |
| 70 |
specific to the Glyphs software should be stored under the key `com.glyphsapp`. |
| 71 |
The value stored under this key may be any data serializable in JSON; typically |
| 72 |
it will be a `dict`. |
| 73 |
|
| 74 |
Note that there is an important distinction between the Python object format |
| 75 |
of this field and the Babelfont-JSON representation. When stored to JSON, this key |
| 76 |
is exported not as `_formatspecific` but as a simple underscore (`_`). |
| 77 |
|
| 78 |
|
| 79 |
|