def METHOD_NAME(self, name, attrs, content, ttFont):
    if name == "ref":
        # glyph is a "dupe", i.e. a reference to another glyph's image data.
        # in this case imageData contains the glyph id of the reference glyph
        # get glyph id from glyphname
        glyphname = safeEval("'''" + attrs["glyphname"] + "'''")
        self.imageData = struct.pack(">H", ttFont.getGlyphID(glyphname))
        self.referenceGlyphName = glyphname
    elif name == "hexdata":
        self.imageData = readHex(content)
    else:
        from fontTools import ttLib
        raise ttLib.TTLibError("can't handle '%s' element" % name)