code: def recalc(self, ttFont):
      if "vmtx" not in ttFont:
          return
  
      vmtxTable = ttFont["vmtx"]
      self.advanceHeightMax = max(
          adv for adv, _ in vmtxTable.metrics.values()
      )
  
      boundsHeightDict = {}
      if "glyf" in ttFont:
          glyfTable = ttFont["glyf"]
          for name in ttFont.getGlyphOrder():
              g = glyfTable[name]
              if g.numberOfContours == 0:
                  continue
              if g.numberOfContours < 0 and not hasattr(g, "yMax"):
                  # Composite glyph without extents set.
                  # Calculate those.
                  g.recalcBounds(glyfTable)
              boundsHeightDict[name] = g.yMax - g.yMin
      elif "CFF " in ttFont or "CFF2" in ttFont:
          if "CFF " in ttFont:
              topDict = ttFont["CFF "].cff.topDictIndex[0]
          else:
              topDict = ttFont["CFF2"].cff.topDictIndex[0]
          charStrings = topDict.CharStrings
          for name in ttFont.getGlyphOrder():
              cs = charStrings[name]
              bounds = cs.calcBounds(charStrings)
              if bounds is not None:
                  boundsHeightDict[name] = int(
                      math.ceil(bounds[3]) - math.floor(bounds[1])
                  )
  
      if boundsHeightDict:
          minTopSideBearing = float("inf")
          minBottomSideBearing = float("inf")
          yMaxExtent = -float("inf")
          for name, boundsHeight in boundsHeightDict.items():
              advanceHeight, tsb = vmtxTable[name]
              bsb = advanceHeight - tsb - boundsHeight
              extent = tsb + boundsHeight
              minTopSideBearing = min(minTopSideBearing, tsb)
              minBottomSideBearing = min(minBottomSideBearing, bsb)
              yMaxExtent = max(yMaxExtent, extent)
          self.minTopSideBearing = minTopSideBearing
          self.minBottomSideBearing = minBottomSideBearing
          self.yMaxExtent = yMaxExtent
  
      else:  # No glyph has outlines.
          self.minTopSideBearing = 0
          self.minBottomSideBearing = 0
          self.yMaxExtent = 0
  
file_path: catboost/contrib/python/fonttools/fontTools/ttLib/tables/_v_h_e_a.py
imports: from fontTools.misc import sstruct
  from fontTools.misc.textTools import safeEval
  from fontTools.misc.fixedTools import ensureVersionIsLong, versionToFixed
  from .None import DefaultTable
  import math
label_desc: Use image node_id 3 for calling the table__v_h_e_a obj's underlying member method code with example usage: obj.recalc(ttFont) without return types