code: def toXML(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()
  
file_path: catboost/contrib/python/fonttools/fontTools/ttLib/tables/_h_d_m_x.py
imports: from fontTools.misc import sstruct
  from fontTools.misc.textTools import bytechr, byteord, strjoin
  from .None import DefaultTable
  import array
  from collections.abc import Mapping
label_desc: Use image node_id 3 for calling the table__h_d_m_x obj's underlying member method code with example usage: obj.toXML(writer, ttFont) without return types