# Font

## Must Override

BaseFont._close(**kwargs)

  This is the environment implementation of `BaseFont.close`.

  Subclasses must override this method.

BaseFont._generate(format, path, environmentOptions, **kwargs)

  This is the environment implementation of `BaseFont.generate`. format will be a String defining the output format. Refer to the `BaseFont.generate` documentation for the standard format identifiers. If the value given for format is not supported by the environment, the environment must raise `FontPartsError`. path will be a String defining the location where the file should be created. It will have been normalized with `normalizers.normalizeFilePath`. environmentOptions will be a dictionary of names validated with `BaseFont._isValidGenerateEnvironmentOption` nd the given values. These values will not have been passed through any normalization functions.

  Subclasses must override this method.

BaseFont._getGuideline(index, **kwargs)

  This must return a `BaseGuideline` object. index will be a valid index.

  Subclasses must override this method.

BaseFont._get_defaultLayer()

BaseFont._get_features()

  This is the environment implementation of `BaseFont.features`. This must return an instance of a `BaseFeatures` subclass.

  Subclasses must override this method.

BaseFont._get_glyphOrder()

  This is the environment implementation of `BaseFont.glyphOrder`. This must return an Immutable List containing glyph names representing the glyph order in the font. The value will be normalized with `normalizers.normalizeGlyphOrder`.

  Subclasses must override this method.

BaseFont._get_groups()

  This is the environment implementation of `BaseFont.groups`. This must return an instance of a `BaseGroups` subclass.

  Subclasses must override this method.

BaseFont._get_info()

  This is the environment implementation of `BaseFont.info`. This must return an instance of a `BaseInfo` subclass.

  Subclasses must override this method.

BaseFont._get_kerning()

  This is the environment implementation of `BaseFont.kerning`. This must return an instance of a `BaseKerning` subclass.

  Subclasses must override this method.

BaseFont._get_layerOrder(**kwargs)

  This is the environment implementation of `BaseFont.layerOrder`. This must return an Immutable List defining the order of the layers in the font. The contents of the list must be layer names as String. The list will be normalized with `normalizers.normalizeLayerOrder`.

  Subclasses must override this method.

BaseFont._get_layers(**kwargs)

  This is the environment implementation of `BaseFont.layers`. This must return an Immutable List containing instances of `BaseLayer` subclasses. The items in the list should be in the order defined by `BaseFont.layerOrder`.

  Subclasses must override this method.

BaseFont._get_lib()

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

  Subclasses must override this method.

BaseFont._get_path(**kwargs)

  This is the environment implementation of `BaseFont.path`.

  This must return a String defining the location of the file or `None` indicating that the font does not have a file representation. If the returned value is not `None` it will be normalized with `normalizers.normalizeFilePath`.

  Subclasses must override this method.

BaseFont._init(pathOrObject=None, showInterface=True, **kwargs)

  Initialize this object. This should wrap a native font object based on the values for pathOrObject:

  None | Create a new font.
  string | Open the font file located at the given location.
  native font object | Wrap the given object.

  If showInterface is `False`, the font should be created without graphical interface.

  Subclasses must override this method.

BaseFont._lenGuidelines(**kwargs)

  This must return an integer indicating the number of font-level guidelines in the font.

  Subclasses must override this method.

BaseFont._newLayer(name, color, **kwargs)

  This is the environment implementation of `BaseFont.newLayer`. name will be a String representing a valid layer name. The value will have been normalized with `normalizers.normalizeLayerName` and name will not be the same as the name of an existing layer. color will be a Color or `None`. If the value is not `None` the value will have been normalized with `normalizers.normalizeColor`. This must return an instance of a `BaseLayer` subclass that represents the new layer.

  Subclasses must override this method.

BaseFont._removeGuideline(index, **kwargs)

  This is the environment implementation of `BaseFont.removeGuideline`. index will be a valid index.

  Subclasses must override this method.

BaseFont._removeLayer(name, **kwargs)

  This is the environment implementation of `BaseFont.removeLayer`. name will be a String defining the name of an existing layer. The value will have been normalized with `normalizers.normalizeLayerName`.

  Subclasses must override this method.

BaseFont._save(path=None, showProgress=False, formatVersion=None, fileStructure=None, **kwargs)

  This is the environment implementation of `BaseFont.save`. path will be a String or `None`. If path is not `None`, the value will have been normalized with `normalizers.normalizeFilePath`. showProgress will be a `bool` indicating if the environment should display a progress bar during the operation. Environments are not required to display a progress bar even if showProgess is `True`. formatVersion will be Integer/Float or `None` indicating the file format version to write the data into. It will have been normalized with `normalizers.normalizeFileFormatVersion`.

  Subclasses must override this method.

BaseFont._set_defaultLayer(layer)

BaseFont._set_glyphOrder(value)

  This is the environment implementation of `BaseFont.glyphOrder`. value will be a list of String. It will have been normalized with `normalizers.normalizeGlyphOrder`.

  Subclasses must override this method.

BaseFont._set_layerOrder(value, **kwargs)

  This is the environment implementation of `BaseFont.layerOrder`. value will be a list of String representing layer names. The list will have been normalized with `normalizers.normalizeLayerOrder`.

  Subclasses must override this method.

## May Override

BaseFont._appendGuideline(position, angle, name=None, color=None, identifier=None, **kwargs)

  This is the environment implementation of `BaseFont.appendGuideline`. position will be a valid Coordinate. angle will be a valid angle. name will be a valid String or `None`. color will be a valid Color or `None`. This must return the newly created `BaseGuideline` object.

  Subclasses may override this method.

BaseFont._autoUnicodes()

  This is the environment implementation of `BaseFont.autoUnicodes`.

  Subclasses may override this method.

BaseFont._clearGuidelines()

  This is the environment implementation of `BaseFont.clearGuidelines`.

  Subclasses may override this method.

BaseFont._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.

BaseFont._getItem(name, **kwargs)

  This is the environment implementation of `BaseFont.__getitem__`. name will be a String defining an existing glyph in the default layer. The value will have been normalized with `normalizers.normalizeGlyphName`.

  Subclasses may override this method.

BaseFont._getLayer(name, **kwargs)

  This is the environment implementation of `BaseFont.getLayer`. name will be a String. It will have been normalized with `normalizers.normalizeLayerName` and it will have been verified as an existing layer. This must return an instance of `BaseLayer`.

  Subclasses may override this method.

BaseFont._get_guidelines()

  This is the environment implementation of `BaseFont.guidelines`. This must return an Immutable List of `BaseGuideline` objects.

  Subclasses may override this method.

BaseFont._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.

BaseFont._interpolate(factor, minFont, maxFont, round=True, suppressError=True)

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

  Subclasses may override this method.

BaseFont._isCompatible(other, reporter)

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

  Subclasses may override this method.

BaseFont._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.

BaseFont._keys(**kwargs)

  This is the environment implementation of `BaseFont.keys`. This must return an Immutable List of all glyph names in the default layer.

  Subclasses may override this method.

BaseFont._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.

BaseFont._newGlyph(name, **kwargs)

  This is the environment implementation of `BaseFont.newGlyph`. name will be a String representing a valid glyph name. The value will have been tested to make sure that an existing glyph in the default layer does not have an identical name. The value will have been normalized with `normalizers.normalizeGlyphName`. This must return an instance of `BaseGlyph` representing the new glyph.

  Subclasses may override this method.

BaseFont._removeGlyph(name, **kwargs)

  This is the environment implementation of `BaseFont.removeGlyph`. name will be a String representing an existing glyph in the default layer. The value will have been normalized with `normalizers.normalizeGlyphName`.

  Subclasses may override this method.

BaseFont._round()

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

  Subclasses may override this method.

Previous

Subclassing fontObjects.base

Next

Info