def collectMastersForGlyph(self, glyphName, decomposeComponents=False):
items = []<EOL>empties = []<EOL>foundEmpty = False<EOL>for sourceDescriptor in self.sources:<EOL><INDENT>if not os.path.exists(sourceDescriptor.path):<EOL><INDENT>p = "<STR_LIT>" % sourceDescriptor.path<EOL>if p not in self.problems:<EOL><INDENT>self.problems.append(p)<EOL><DEDENT>continue<EOL><DEDENT>if glyphName in sourceDescriptor.mutedGlyphNames:<EOL><INDENT>continue<EOL><DEDENT>thisIsDefault = self.default == sourceDescriptor<EOL>ignoreMaster, filteredLocation = self.filterThisLocation(sourceDescriptor.location, self.mutedAxisNames)<EOL>if ignoreMaster:<EOL><INDENT>continue<EOL><DEDENT>f = self.fonts.get(sourceDescriptor.name)<EOL>if f is None: continue<EOL>loc = Location(sourceDescriptor.location)<EOL>sourceLayer = f<EOL>if not glyphName in f:<EOL><INDENT>continue<EOL><DEDENT>layerName = getDefaultLayerName(f)<EOL>sourceGlyphObject = None<EOL>if sourceDescriptor.layerName is not None:<EOL><INDENT>layerName = sourceDescriptor.layerName<EOL>sourceLayer = getLayer(f, sourceDescriptor.layerName)<EOL>if sourceLayer is None:<EOL><INDENT>continue<EOL><DEDENT>if glyphName not in sourceLayer:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>if not glyphName in sourceLayer:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>sourceGlyphObject = sourceLayer[glyphName]<EOL>if checkGlyphIsEmpty(sourceGlyphObject, allowWhiteSpace=True):<EOL><INDENT>foundEmpty = True<EOL><DEDENT><DEDENT>if decomposeComponents:<EOL><INDENT>temp = self.glyphClass()<EOL>p = temp.getPointPen()<EOL>dpp = DecomposePointPen(sourceLayer, p)<EOL>sourceGlyphObject.drawPoints(dpp)<EOL>temp.width = sourceGlyphObject.width<EOL>temp.name = sourceGlyphObject.name<EOL>processThis = temp<EOL><DEDENT>else:<EOL><INDENT>processThis = sourceGlyphObject<EOL><DEDENT>sourceInfo = dict(source=f.path, glyphName=glyphName,<EOL>layerName=layerName,<EOL>location=filteredLocation,  <EOL>sourceName=sourceDescriptor.name,<EOL>)<EOL>if hasattr(processThis, "<STR_LIT>"):<EOL><INDENT>processThis = processThis.toMathGlyph()<EOL><DEDENT>else:<EOL><INDENT>processThis = self.mathGlyphClass(processThis)<EOL><DEDENT>items.append((loc, processThis, sourceInfo))<EOL>empties.append((thisIsDefault, foundEmpty))<EOL><DEDENT>checkedItems = []<EOL>emptiesAllowed = False<EOL>for i, p in enumerate(empties):<EOL><INDENT>isDefault, isEmpty = p<EOL>if isDefault and isEmpty:<EOL><INDENT>emptiesAllowed = True<EOL><DEDENT><DEDENT>if not emptiesAllowed:<EOL><INDENT>for i, p in enumerate(empties):<EOL><INDENT>isDefault, isEmpty = p<EOL>if not isEmpty:<EOL><INDENT>checkedItems.append(items[i])<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for i, p in enumerate(empties):<EOL><INDENT>isDefault, isEmpty = p<EOL>if isEmpty:<EOL><INDENT>checkedItems.append(items[i])<EOL><DEDENT><DEDENT><DEDENT>return checkedItems<EOL>
Return a glyph mutator.defaultLoc
            decomposeComponents = True causes the source glyphs to be decomposed first
            before building the mutator. That gives you instances that do not depend
            on a complete font. If you're calculating previews for instance.

            XXX check glyphs in layers