def _calculateGlyph(self, targetGlyphObject, instanceLocationObject, glyphMasters):
        """
        Build a Mutator object for this glyph.

        *   name:   glyphName
        *   location:   Location object
        *   glyphMasters:    dict with font objects.
        """
        sources = None
        items = []

        for item in glyphMasters:
            locationObject = item['location']
            fontObject = item['font']
            glyphName = item['glyphName']
            if not glyphName in fontObject:
                continue
            glyphObject = MathGlyph(fontObject[glyphName])
            items.append((locationObject, glyphObject))
        bias, m = buildMutator(items, axes=self.axes)
        instanceObject = m.makeInstance(instanceLocationObject)
        if self.roundGeometry:
            try:
                instanceObject = instanceObject.round()
            except AttributeError:
                if self.verbose and self.logger:
                    self.logger.info("MathGlyph object missing round() method.")


        try:
            instanceObject.extractGlyph(targetGlyphObject, onlyGeometry=True)
        except TypeError:
            # this causes ruled glyphs to end up in the wrong glyphname
            # but defcon2 objects don't support it
            pPen = targetGlyphObject.getPointPen()
            targetGlyphObject.clear()
            instanceObject.drawPoints(pPen)
            targetGlyphObject.width = instanceObject.width
def _calculateGlyph ( self , targetGlyphObject , instanceLocationObject , glyphMasters ) : sources = None items = [ ] for item in glyphMasters : locationObject = item [ 'location' ] fontObject = item [ 'font' ] glyphName = item [ 'glyphName' ] if not glyphName in fontObject : continue glyphObject = MathGlyph ( fontObject [ glyphName ] ) items . append ( ( locationObject , glyphObject ) ) bias , m = buildMutator ( items , axes = self . axes ) instanceObject = m . makeInstance ( instanceLocationObject ) if self . roundGeometry : try : instanceObject = instanceObject . round ( ) except AttributeError : if self . verbose and self . logger : self . logger . info ( "MathGlyph object missing round() method." ) try : instanceObject . extractGlyph ( targetGlyphObject , onlyGeometry = True ) except TypeError : pPen = targetGlyphObject . getPointPen ( ) targetGlyphObject . clear ( ) instanceObject . drawPoints ( pPen ) targetGlyphObject . width = instanceObject . width
Build a Mutator object for this glyph.

        *   name:   glyphName
        *   location:   Location object
        *   glyphMasters:    dict with font objects.