Font¶
Must Override¶
- BaseFont._close(**kwargs)[source]¶
This is the environment implementation of
BaseFont.close
.Subclasses must override this method.
- BaseFont._generate(format, path, environmentOptions, **kwargs)[source]¶
This is the environment implementation of
BaseFont.generate
. format will be a String defining the output format. Refer to theBaseFont.generate
documentation for the standard format identifiers. If the value given for format is not supported by the environment, the environment must raiseFontPartsError
. path will be a String defining the location where the file should be created. It will have been normalized withnormalizers.normalizeFilePath
. environmentOptions will be a dictionary of names validated withBaseFont._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)[source]¶
This must return a
BaseGuideline
object. index will be a valid index.Subclasses must override this method.
- BaseFont._get_features()[source]¶
This is the environment implementation of
BaseFont.features
. This must return an instance of aBaseFeatures
subclass.Subclasses must override this method.
- BaseFont._get_glyphOrder()[source]¶
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 withnormalizers.normalizeGlyphOrder
.Subclasses must override this method.
- BaseFont._get_groups()[source]¶
This is the environment implementation of
BaseFont.groups
. This must return an instance of aBaseGroups
subclass.Subclasses must override this method.
- BaseFont._get_info()[source]¶
This is the environment implementation of
BaseFont.info
. This must return an instance of aBaseInfo
subclass.Subclasses must override this method.
- BaseFont._get_kerning()[source]¶
This is the environment implementation of
BaseFont.kerning
. This must return an instance of aBaseKerning
subclass.Subclasses must override this method.
- BaseFont._get_layerOrder(**kwargs)[source]¶
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 withnormalizers.normalizeLayerOrder
.Subclasses must override this method.
- BaseFont._get_layers(**kwargs)[source]¶
This is the environment implementation of
BaseFont.layers
. This must return an Immutable List containing instances ofBaseLayer
subclasses. The items in the list should be in the order defined byBaseFont.layerOrder
.Subclasses must override this method.
- BaseFont._get_lib()[source]¶
This is the environment implementation of
BaseFont.lib
. This must return an instance of aBaseLib
subclass.Subclasses must override this method.
- BaseFont._get_path(**kwargs)[source]¶
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 notNone
it will be normalized withnormalizers.normalizeFilePath
.Subclasses must override this method.
- BaseFont._init(pathOrObject=None, showInterface=True, **kwargs)[source]¶
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)[source]¶
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)[source]¶
This is the environment implementation of
BaseFont.newLayer
. name will be a String representing a valid layer name. The value will have been normalized withnormalizers.normalizeLayerName
and name will not be the same as the name of an existing layer. color will be a Color orNone
. If the value is notNone
the value will have been normalized withnormalizers.normalizeColor
. This must return an instance of aBaseLayer
subclass that represents the new layer.Subclasses must override this method.
- BaseFont._removeGuideline(index, **kwargs)[source]¶
This is the environment implementation of
BaseFont.removeGuideline
. index will be a valid index.Subclasses must override this method.
- BaseFont._removeLayer(name, **kwargs)[source]¶
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 withnormalizers.normalizeLayerName
.Subclasses must override this method.
- BaseFont._save(path=None, showProgress=False, formatVersion=None, fileStructure=None, **kwargs)[source]¶
This is the environment implementation of
BaseFont.save
. path will be a String orNone
. If path is notNone
, the value will have been normalized withnormalizers.normalizeFilePath
. showProgress will be abool
indicating if the environment should display a progress bar during the operation. Environments are not required to display a progress bar even if showProgess isTrue
. formatVersion will be Integer/Float orNone
indicating the file format version to write the data into. It will have been normalized withnormalizers.normalizeFileFormatVersion
.Subclasses must override this method.
- BaseFont._set_glyphOrder(value)[source]¶
This is the environment implementation of
BaseFont.glyphOrder
. value will be a list of String. It will have been normalized withnormalizers.normalizeGlyphOrder
.Subclasses must override this method.
- BaseFont._set_layerOrder(value, **kwargs)[source]¶
This is the environment implementation of
BaseFont.layerOrder
. value will be a list of String representing layer names. The list will have been normalized withnormalizers.normalizeLayerOrder
.Subclasses must override this method.
May Override¶
- BaseFont._appendGuideline(position, angle, name=None, color=None, identifier=None, **kwargs)[source]¶
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 orNone
. color will be a valid Color orNone
. This must return the newly createdBaseGuideline
object.Subclasses may override this method.
- BaseFont._autoUnicodes()[source]¶
This is the environment implementation of
BaseFont.autoUnicodes
.Subclasses may override this method.
- BaseFont._clearGuidelines()[source]¶
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__
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.
- BaseFont._getItem(name, **kwargs)[source]¶
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 withnormalizers.normalizeGlyphName
.Subclasses may override this method.
- BaseFont._getLayer(name, **kwargs)[source]¶
This is the environment implementation of
BaseFont.getLayer
. name will be a String. It will have been normalized withnormalizers.normalizeLayerName
and it will have been verified as an existing layer. This must return an instance ofBaseLayer
.Subclasses may override this method.
- BaseFont._get_guidelines()[source]¶
This is the environment implementation of
BaseFont.guidelines
. This must return an Immutable List ofBaseGuideline
objects.Subclasses may override this method.
- BaseFont._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.
- BaseFont._interpolate(factor, minFont, maxFont, round=True, suppressError=True)[source]¶
This is the environment implementation of
BaseFont.interpolate
.Subclasses may override this method.
- BaseFont._isCompatible(other, reporter)[source]¶
This is the environment implementation of
BaseFont.isCompatible
.Subclasses may override this method.
- BaseFont._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.
- BaseFont._keys(**kwargs)[source]¶
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__
andBaseFont.__len__
This must return anint
indicating the number of glyphs in the layer.Subclasses may override this method.
- BaseFont._newGlyph(name, **kwargs)[source]¶
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 withnormalizers.normalizeGlyphName
. This must return an instance ofBaseGlyph
representing the new glyph.Subclasses may override this method.
- BaseFont._removeGlyph(name, **kwargs)[source]¶
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 withnormalizers.normalizeGlyphName
.Subclasses may override this method.
- BaseFont._round()[source]¶
This is the environment implementation of
BaseFont.round
.Subclasses may override this method.