code: def decompile(self, data, ttFont):
      numGlyphs = ttFont["maxp"].numGlyphs
      headerTable = ttFont.get(self.headerTag)
      if headerTable is not None:
          numberOfMetrics = int(
              getattr(headerTable, self.numberOfMetricsName)
          )
      else:
          numberOfMetrics = numGlyphs
      if numberOfMetrics > numGlyphs:
          log.warning(
              "The %s.%s exceeds the maxp.numGlyphs"
              % (self.headerTag, self.numberOfMetricsName)
          )
          numberOfMetrics = numGlyphs
      if len(data) < 4 * numberOfMetrics:
          raise ttLib.TTLibError(
              "not enough '%s' table data" % self.tableTag
          )
      # Note: advanceWidth is unsigned, but some font editors might
      # read/write as signed. We can't be sure whether it was a mistake
      # or not, so we read as unsigned but also issue a warning...
      metricsFmt = ">" + self.longMetricFormat * numberOfMetrics
      metrics = struct.unpack(metricsFmt, data[: 4 * numberOfMetrics])
      data = data[4 * numberOfMetrics :]
      numberOfSideBearings = numGlyphs - numberOfMetrics
      sideBearings = array.array("h", data[: 2 * numberOfSideBearings])
      data = data[2 * numberOfSideBearings :]
  
      if sys.byteorder != "big":
          sideBearings.byteswap()
      if data:
          log.warning("too much '%s' table data" % self.tableTag)
      self.metrics = {}
      glyphOrder = ttFont.getGlyphOrder()
      for i in range(numberOfMetrics):
          glyphName = glyphOrder[i]
          advanceWidth, lsb = metrics[i * 2 : i * 2 + 2]
          if advanceWidth > 32767:
              log.warning(
                  "Glyph %r has a huge advance %s (%d); is it intentional or "
                  "an (invalid) negative value?",
                  glyphName,
                  self.advanceName,
                  advanceWidth,
              )
          self.metrics[glyphName] = (advanceWidth, lsb)
      lastAdvance = metrics[-2]
      for i in range(numberOfSideBearings):
          glyphName = glyphOrder[i + numberOfMetrics]
          self.metrics[glyphName] = (lastAdvance, sideBearings[i])
  
file_path: catboost/contrib/python/fonttools/fontTools/ttLib/tables/_h_m_t_x.py
imports: from fontTools.misc.roundTools import otRound
  from fontTools import ttLib
  from fontTools.misc.textTools import safeEval
  from .None import DefaultTable
  import sys
  import struct
  import array
  import logging
label_desc: Use image node_id 1 for calling the table__h_m_t_x obj's underlying member method code with example usage: obj.decompile(data, ttFont) without return types