Layer¶
Must Override¶
-
BaseLayer.
_getItem
(name, **kwargs)¶ This is the environment implementation of
BaseLayer.__getitem__
andBaseFont.__getitem__
This must return an instance of aBaseGlyph
subclass. name will be a String representing a name of a glyph that is in the layer. It will have been normalized withnormalizers.normalizeGlyphName
.Subclasses must override this method.
-
BaseLayer.
_get_color
()[source]¶ This is the environment implementation of
BaseLayer.color
. This must return a Color defining the color assigned to the layer. If the layer does not have an assigned color, the returned value must beNone
. It will be normalized withnormalizers.normalizeColor
.Subclasses must override this method.
-
BaseLayer.
_get_lib
()[source]¶ This is the environment implementation of
BaseLayer.lib
. This must return an instance of aBaseLib
subclass.
-
BaseLayer.
_get_name
()[source]¶ This is the environment implementation of
BaseLayer.name
. This must return a String defining the name of the layer. If the layer is the default layer, the returned value must beNone
. It will be normalized withnormalizers.normalizeLayerName
.Subclasses must override this method.
-
BaseLayer.
_keys
(**kwargs)¶ This is the environment implementation of
BaseLayer.keys
andBaseFont.keys
This must return an Immutable List of the names representing all glyphs in the layer. The order is not defined.Subclasses must override this method.
-
BaseLayer.
_newGlyph
(name, **kwargs)¶ This is the environment implementation of
BaseLayer.newGlyph
andBaseFont.newGlyph
This must return an instance of aBaseGlyph
subclass. name will be a String representing a glyph name. It will have been normalized withnormalizers.normalizeGlyphName
. The name will have been tested to make sure that no glyph with the same name exists in the layer.Subclasses must override this method.
-
BaseLayer.
_removeGlyph
(name, **kwargs)¶ This is the environment implementation of
BaseLayer.removeGlyph
andBaseFont.removeGlyph
. name will be a String representing a glyph name of a glyph that is in the layer. It will have been normalized withnormalizers.normalizeGlyphName
. The newly createdBaseGlyph
must be returned.Subclasses must override this method.
-
BaseLayer.
_set_color
(value, **kwargs)[source]¶ This is the environment implementation of
BaseLayer.color
. value will be a Color orNone
defining the color to assign to the layer. It will have been normalized withnormalizers.normalizeColor
.Subclasses must override this method.
-
BaseLayer.
_set_name
(value, **kwargs)[source]¶ This is the environment implementation of
BaseLayer.name
. value will be a String defining the name of the layer. It will have been normalized withnormalizers.normalizeLayerName
. No layer with the same name will exist.Subclasses must override this method.
May Override¶
-
BaseLayer.
_autoUnicodes
()[source]¶ This is the environment implementation of
BaseLayer.autoUnicodes
.Subclasses may override this method.
-
BaseLayer.
_contains
(name, **kwargs)¶ This is the environment implementation of
BaseLayer.__contains__
andBaseFont.__contains__
This must returnbool
indicating if the layer has a glyph with the defined name. name will be a :ref-type-string` representing a glyph name. It will have been normalized withnormalizers.normalizeGlyphName
.Subclasses may override this method.
-
BaseLayer.
_init
(*args, **kwargs)¶ Subclasses may override this method.
-
BaseLayer.
_insertGlyph
(glyph, name, **kwargs)¶ This is the environment implementation of
BaseLayer.__setitem__
andBaseFont.__setitem__
. This must return an instance of aBaseGlyph
subclass. glyph will be a glyph object with the attributes necessary for copying as defined inBaseGlyph.copy
An environment must not insert glyph directly. Instead the data from glyph should be copied to a new glyph instead. name will be a String representing a glyph name. It will have been normalized withnormalizers.normalizeGlyphName
. name will have been tested to make sure that no glyph with the same name exists in the layer.Subclasses may override this method.
-
BaseLayer.
_interpolate
(factor, minLayer, maxLayer, round=True, suppressError=True)[source]¶ This is the environment implementation of
BaseLayer.interpolate
.Subclasses may override this method.
-
BaseLayer.
_isCompatible
(other, reporter)[source]¶ This is the environment implementation of
BaseLayer.isCompatible
.Subclasses may override this method.
-
BaseLayer.
_iter
(**kwargs)¶ This is the environment implementation of
BaseLayer.__iter__
andBaseFont.__iter__
This must return an iterator that returns instances of aBaseGlyph
subclass.Subclasses may override this method.
-
BaseLayer.
_len
(**kwargs)¶ This is the environment implementation of
BaseLayer.__len__
andBaseFont.__len__
This must return anint
indicating the number of glyphs in the layer.Subclasses may override this method.
-
BaseLayer.
_round
()[source]¶ This is the environment implementation of
BaseLayer.round
.Subclasses may override this method.