code: def _toMathGlyph(self):
          
          import fontMath
          mathGlyph = fontMath.MathGlyph(None)
          pen = mathGlyph.getPointPen()
          self.drawPoints(pen)
          for anchor in self.anchors:
              d = dict(
                  x=anchor.x,
                  y=anchor.y,
                  name=anchor.name,
                  identifier=anchor.identifier,
                  color=anchor.color
              )
              mathGlyph.anchors.append(d)
          for guideline in self.guidelines:
              d = dict(
                  x=guideline.x,
                  y=guideline.y,
                  angle=guideline.angle,
                  name=guideline.name,
                  identifier=guideline.identifier,
                  color=guideline.color
              )
              mathGlyph.guidelines.append(d)
          image = self.image
          mathGlyph.image = dict(
              # MathGlyph works with image file names, hack
              # around it by using the data as the file name.
              fileName=image.data,
              transformation=image.transformation,
              color=image.color
          )
          mathGlyph.lib = deepcopy(self.lib)
          mathGlyph.name = self.name
          mathGlyph.unicodes = self.unicodes
          mathGlyph.width = self.width
          mathGlyph.height = self.height
          mathGlyph.note = self.note
          return mathGlyph
docs: Subclasses may override this method.