1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
---
title: Layer
---
Layer(width: int = 0, height: int = 0, name: str = None, _master: str = None, id: str = <factory>, guides: [<class 'babelfont.Guide.Guide'>] = <factory>, shapes: [<class 'babelfont.Shape.Shape'>] = <factory>, anchors: [<class 'babelfont.Anchor.Anchor'>] = <factory>, color: babelfont.BaseObject.Color = None, layerIndex: int = 0, _background: str = None, isBackground: bool = False, location: [<class 'float'>] = None, _font: object = None, _formatspecific: dict = <factory>, _: dict = None)
## Layer.width
* Python type: `int`
*If not provided, defaults to* `0`.
## Layer.height
* Python type: `int`
*If not provided, defaults to* `0`.
## Layer.name
* Python type: `str`
*If not provided, defaults to* `None`.
## Layer._master
* Python type: `str`
*If not provided, defaults to* `None`.
## Layer.id
* Python type: `str`
## Layer.guides
* Python type: [[`Guide`](Guide.html)]
## Layer.shapes
* Python type: [[`Shape`](Shape.html)]
* When writing to Babelfont-JSON, each item in the list must be placed on a separate line.
## Layer.anchors
* Python type: [[`Anchor`](Anchor.html)]
## Layer.color
* Python type: `Color`
*If not provided, defaults to* `None`.
## Layer.layerIndex
* Python type: `int`
*If not provided, defaults to* `0`.
## Layer._background
* Python type: `str`
*If not provided, defaults to* `None`.
## Layer.isBackground
* Python type: `bool`
*If not provided, defaults to* `False`.
## Layer.location
* Python type: `[float]`
*If not provided, defaults to* `None`.
## Layer._font
* Python type: `object`
* This field only exists as an attribute of the the Python object and should not be written to Babelfont-JSON.
*If not provided, defaults to* `None`.
## Layer._formatspecific
* Python type: `dict`
Each object in Babelfont has an optional attached dictionary to allow the storage
of format-specific information. Font creation software may store any additional
information that they wish to have preserved on import and export under a
namespaced (reverse-domain) key in this dictionary. For example, information
specific to the Glyphs software should be stored under the key `com.glyphsapp`.
The value stored under this key may be any data serializable in JSON; typically
it will be a `dict`.
Note that there is an important distinction between the Python object format
of this field and the Babelfont-JSON representation. When stored to JSON, this key
is exported not as `_formatspecific` but as a simple underscore (`_`).
|