# Glyph

## Must Override

BaseGlyph._addImage(data, transformation=None, color=None)

  data will be raw, unnormalized image data. Each environment may have different possible formats, so this is unspecified.

  transformation will be a valid transformation matrix.

  color will be a color tuple or None.

  This must return an Image object. Assigning it to the glyph will be handled by the base class.

  Subclasses must override this method.

BaseGlyph._autoUnicodes()

  Subclasses must override this method.

BaseGlyph._clearImage(**kwargs)

  Subclasses must override this method.

BaseGlyph._getAnchor(index, **kwargs)

  This must return a wrapped anchor.

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._getComponent(index, **kwargs)

  This must return a wrapped component.

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._getContour(index, **kwargs)

  This must return a wrapped contour.

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._getGuideline(index, **kwargs)

  This must return a wrapped guideline.

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._get_height()

  This must return an int or float.

  Subclasses must override this method.

BaseGlyph._get_image()

  Subclasses must override this method.

BaseGlyph._get_lib()

  Subclasses must override this method.

BaseGlyph._get_markColor()

  Return the mark color value as a color tuple or None.

  Subclasses must override this method.

BaseGlyph._get_name()

  Get the name of the glyph. This must return a unicode string.

  Subclasses must override this method.

BaseGlyph._get_note()

  Subclasses must override this method.

BaseGlyph._get_unicodes()

  Get the unicodes assigned to the glyph. This must return a tuple of zero or more integers.

  Subclasses must override this method.

BaseGlyph._get_width()

  This must return an int or float.

  Subclasses must override this method.

BaseGlyph._lenAnchors(**kwargs)

  This must return an integer indicating the number of anchors in the glyph.

  Subclasses must override this method.

BaseGlyph._lenComponents(**kwargs)

  This must return an integer indicating the number of components in the glyph.

  Subclasses must override this method.

BaseGlyph._lenContours(**kwargs)

  This must return an integer.

  Subclasses must override this method.

BaseGlyph._lenGuidelines(**kwargs)

  This must return an integer indicating the number of guidelines in the glyph.

  Subclasses must override this method.

BaseGlyph._newLayer(name, **kwargs)

  name will be a string representing a valid layer name. The name will have been tested to make sure that no layer in the glyph already has the name.

  This must returned the new glyph.

  Subclasses must override this method.

BaseGlyph._removeAnchor(index, **kwargs)

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._removeComponent(index, **kwargs)

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._removeContour(index, **kwargs)

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._removeGuideline(index, **kwargs)

  index will be a valid index.

  Subclasses must override this method.

BaseGlyph._removeOverlap()

  Subclasses must implement this method.

BaseGlyph._set_height(value)

  value will be an int or float.

  Subclasses must override this method.

BaseGlyph._set_markColor(value)

  value will be a color tuple or None.

  Subclasses must override this method.

BaseGlyph._set_name(value)

  Set the name of the glyph. This will be a unicode string.

  Subclasses must override this method.

BaseGlyph._set_note(value)

  Subclasses must override this method.

BaseGlyph._set_unicodes(value)

  Assign the unicodes to the glyph. This will be a list of zero or more integers.

  Subclasses must override this method.

BaseGlyph._set_width(value)

  value will be an int or float.

  Subclasses must override this method.

## May Override

BaseGlyph.__add__(other)

  Subclasses may override this method.

BaseGlyph.__div__(factor)

  Subclasses may override this method.

BaseGlyph.__mul__(factor)

  Subclasses may override this method.

BaseGlyph.__rmul__(factor)

  Subclasses may override this method.

BaseGlyph.__sub__(other)

  Subclasses may override this method.

BaseGlyph._appendAnchor(name, position=None, color=None, identifier=None, **kwargs)

  name will be a valid anchor name. position will be a valid position (x, y). color will be None or a valid color. identifier will be a valid, nonconflicting identifier.

  This must return the new anchor.

  Subclasses may override this method.

BaseGlyph._appendComponent(baseGlyph, transformation=None, identifier=None, **kwargs)

  baseGlyph will be a valid glyph name. The baseGlyph may or may not be in the layer.

  offset will be a valid offset (x, y). scale will be a valid scale (x, y). identifier will be a valid, nonconflicting identifier.

  This must return the new component.

  Subclasses may override this method.

BaseGlyph._appendContour(contour, offset=None, **kwargs)

  contour will be an object with a drawPoints method.

  offset will be a valid offset (x, y).

  This must return the new contour.

  Subclasses may override this method.

BaseGlyph._appendGlyph(other, offset=None)

  Subclasses may override this method.

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

  position will be a valid position (x, y). angle will be a valid angle. name will be a valid guideline name or None. color will be a valid color or None . identifier will be a valid, nonconflicting identifier.

  This must return the new guideline.

  Subclasses may override this method.

BaseGlyph._clear(contours=True, components=True, anchors=True, guidelines=True, image=True)

  Subclasses may override this method.

BaseGlyph._clearAnchors()

  Subclasses may override this method.

BaseGlyph._clearComponents()

  Subclasses may override this method.

BaseGlyph._clearContours()

  Subclasses may override this method.

BaseGlyph._clearGuidelines()

  Subclasses may override this method.

BaseGlyph._decompose()

  Subclasses may override this method.

BaseGlyph._getLayer(name, **kwargs)

  name will be a string, but there may not be a layer with a name matching the string. If not, a `ValueError` must be raised.

  Subclasses may override this method.

BaseGlyph._get_anchors()

  Subclasses may override this method.

BaseGlyph._get_bottomMargin()

  This must return an int or float. If the glyph has no outlines, this must return None.

  Subclasses may override this method.

BaseGlyph._get_bounds()

  Subclasses may override this method.

BaseGlyph._get_components()

  Subclasses may override this method.

BaseGlyph._get_contours()

  Subclasses may override this method.

BaseGlyph._get_guidelines()

  Subclasses may override this method.

BaseGlyph._get_leftMargin()

  This must return an int or float. If the glyph has no outlines, this must return None.

  Subclasses may override this method.

BaseGlyph._get_rightMargin()

  This must return an int or float. If the glyph has no outlines, this must return None.

  Subclasses may override this method.

BaseGlyph._get_topMargin()

  This must return an int or float. If the glyph has no outlines, this must return None.

  Subclasses may override this method.

BaseGlyph._get_unicode()

  Get the primary unicode assigned to the glyph. This must return an integer or None.

  Subclasses may override this method.

BaseGlyph._init(*args, **kwargs)

  Subclasses may override this method.

BaseGlyph._interpolate(factor, minGlyph, maxGlyph, round=True, suppressError=True)

  Subclasses may override this method.

BaseGlyph._isCompatible(other, reporter)

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

  Subclasses may override this method.

BaseGlyph._iterContours(**kwargs)

  This must return an iterator that returns wrapped contours.

  Subclasses may override this method.

BaseGlyph._moveBy(value, **kwargs)

  This is the environment implementation of `BaseObject.moveBy`.

  value will be an iterable containing two Integer/Float values defining the x and y values to move the object by. It will have been normalized with `normalizers.normalizeTransformationOffset`.

  Subclasses may override this method.

BaseGlyph._pointInside(point)

  Subclasses may override this method.

BaseGlyph._removeLayer(name, **kwargs)

  name will be a valid layer name. It will represent an existing layer in the font.

  Subclasses may override this method.

BaseGlyph._rotateBy(value, origin=None, **kwargs)

  This is the environment implementation of `BaseObject.rotateBy`.

  value will be a Integer/Float value defining the value to rotate the object by. It will have been normalized with `normalizers.normalizeRotationAngle`. origin will be a Coordinate defining the point at which the rotation should orginate.

  Subclasses may override this method.

BaseGlyph._round()

  Subclasses may override this method.

BaseGlyph._scaleBy(value, origin=None, **kwargs)

  This is the environment implementation of `BaseObject.scaleBy`.

  value will be an iterable containing two Integer/Float values defining the x and y values to scale the object by. It will have been normalized with `normalizers.normalizeTransformationScale`. origin will be a Coordinate defining the point at which the scale should orginate.

  Subclasses may override this method.

BaseGlyph._set_bottomMargin(value)

  value will be an int or float.

  Subclasses may override this method.

BaseGlyph._set_leftMargin(value)

  value will be an int or float.

  Subclasses may override this method.

BaseGlyph._set_rightMargin(value)

  value will be an int or float.

  Subclasses may override this method.

BaseGlyph._set_topMargin(value)

  value will be an int or float.

  Subclasses may override this method.

BaseGlyph._set_unicode(value)

  Assign the primary unicode to the glyph. This will be an integer or None.

  Subclasses may override this method.

BaseGlyph._skewBy(value, origin=None, **kwargs)

  This is the environment implementation of `BaseObject.skewBy`.

  value will be an iterable containing two Integer/Float values defining the x and y values to skew the object by. It will have been normalized with `normalizers.normalizeTransformationSkewAngle`. origin will be a Coordinate defining the point at which the skew should orginate.

  Subclasses may override this method.

BaseGlyph._transformBy(matrix, **kwargs)

  Subclasses may override this method.

Previous

Layer

Next

Contour