# Layer

## Must Override

BaseLayer._getItem(name, **kwargs)

  This is the environment implementation of `BaseLayer.__getitem__` and `BaseFont.__getitem__` This must return an instance of a `BaseGlyph` subclass. name will be a String representing a name of a glyph that is in the layer. It will have been normalized with `normalizers.normalizeGlyphName`.

  Subclasses must override this method.

BaseLayer._get_color()

  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 be `None`. It will be normalized with `normalizers.normalizeColor`.

  Subclasses must override this method.

BaseLayer._get_lib()

  This is the environment implementation of `BaseLayer.lib`. This must return an instance of a `BaseLib` subclass.

BaseLayer._get_name()

  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 be `None`. It will be normalized with `normalizers.normalizeLayerName`.

  Subclasses must override this method.

BaseLayer._keys(**kwargs)

  This is the environment implementation of `BaseLayer.keys` and `BaseFont.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` and `BaseFont.newGlyph` This must return an instance of a `BaseGlyph` subclass. name will be a String representing a glyph name. It will have been normalized with `normalizers.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` and `BaseFont.removeGlyph`. name will be a String representing a glyph name of a glyph that is in the layer. It will have been normalized with `normalizers.normalizeGlyphName`. The newly created `BaseGlyph` must be returned.

  Subclasses must override this method.

BaseLayer._set_color(value, **kwargs)

  This is the environment implementation of `BaseLayer.color`. value will be a Color or `None` defining the color to assign to the layer. It will have been normalized with `normalizers.normalizeColor`.

  Subclasses must override this method.

BaseLayer._set_name(value, **kwargs)

  This is the environment implementation of `BaseLayer.name`. value will be a String defining the name of the layer. It will have been normalized with `normalizers.normalizeLayerName`. No layer with the same name will exist.

  Subclasses must override this method.

## May Override

BaseLayer._autoUnicodes()

  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__` and `BaseFont.__contains__` This must return `bool` 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 with `normalizers.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__` and `BaseFont.__setitem__`. This must return an instance of a `BaseGlyph` subclass. glyph will be a glyph object with the attributes necessary for copying as defined in `BaseGlyph.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 with `normalizers.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)

  This is the environment implementation of `BaseLayer.interpolate`.

  Subclasses may override this method.

BaseLayer._isCompatible(other, reporter)

  This is the environment implementation of `BaseLayer.isCompatible`.

  Subclasses may override this method.

BaseLayer._iter(**kwargs)

  This is the environment implementation of `BaseLayer.__iter__` and `BaseFont.__iter__` This must return an iterator that returns instances of a `BaseGlyph` subclass.

  Subclasses may override this method.

BaseLayer._len(**kwargs)

  This is the environment implementation of `BaseLayer.__len__` and `BaseFont.__len__` This must return an `int` indicating the number of glyphs in the layer.

  Subclasses may override this method.

BaseLayer._round()

  This is the environment implementation of `BaseLayer.round`.

  Subclasses may override this method.

Previous

Lib

Next

Glyph