def METHOD_NAME(self, writer, ttFont):
    writer.begintag("hdmxData")
    writer.newline()
    ppems = sorted(self.hdmx.keys())
    records = []
    format = ""
    for ppem in ppems:
        widths = self.hdmx[ppem]
        records.append(widths)
        format = format + "%4d"
    glyphNames = ttFont.getGlyphOrder()[:]
    glyphNames.sort()
    maxNameLen = max(map(len, glyphNames))
    format = "%" + repr(maxNameLen) + "s:" + format + " ;"
    writer.write(format % (("ppem",) + tuple(ppems)))
    writer.newline()
    writer.newline()
    for glyphName in glyphNames:
        row = []
        for ppem in ppems:
            widths = self.hdmx[ppem]
            row.append(widths[glyphName])
        if ";" in glyphName:
            glyphName = "\\x3b".join(glyphName.split(";"))
        writer.write(format % ((glyphName,) + tuple(row)))
        writer.newline()
    writer.endtag("hdmxData")
    writer.newline()