code: def merge(self, m, tables):
      if any(hasattr(table.cff[0], "FDSelect") for table in tables):
          raise NotImplementedError(
              "Merging CID-keyed CFF tables is not supported yet"
          )
  
      for table in tables:
          table.cff.desubroutinize()
  
      newcff = tables[0]
      newfont = newcff.cff[0]
      private = newfont.Private
      newDefaultWidthX, newNominalWidthX = (
          private.defaultWidthX,
          private.nominalWidthX,
      )
      storedNamesStrings = []
      glyphOrderStrings = []
      glyphOrder = set(newfont.getGlyphOrder())
  
      for name in newfont.strings.strings:
          if name not in glyphOrder:
              storedNamesStrings.append(name)
          else:
              glyphOrderStrings.append(name)
  
      chrset = list(newfont.charset)
      newcs = newfont.CharStrings
      log.debug("FONT 0 CharStrings: %d.", len(newcs))
  
      for i, table in enumerate(tables[1:], start=1):
          font = table.cff[0]
          defaultWidthX, nominalWidthX = (
              font.Private.defaultWidthX,
              font.Private.nominalWidthX,
          )
          widthsDiffer = (
              defaultWidthX != newDefaultWidthX
              or nominalWidthX != newNominalWidthX
          )
          font.Private = private
          fontGlyphOrder = set(font.getGlyphOrder())
          for name in font.strings.strings:
              if name in fontGlyphOrder:
                  glyphOrderStrings.append(name)
          cs = font.CharStrings
          gs = table.cff.GlobalSubrs
          log.debug("Font %d CharStrings: %d.", i, len(cs))
          chrset.extend(font.charset)
          if newcs.charStringsAreIndexed:
              for i, name in enumerate(
                  cs.charStrings, start=len(newcs)
              ):
                  newcs.charStrings[name] = i
                  newcs.charStringsIndex.items.append(None)
          for name in cs.charStrings:
              if widthsDiffer:
                  c = cs[name]
                  defaultWidthXToken = object()
                  extractor = T2WidthExtractor(
                      [], [], nominalWidthX, defaultWidthXToken
                  )
                  extractor.execute(c)
                  width = extractor.width
                  if width is not defaultWidthXToken:
                      c.program.pop(0)
                  else:
                      width = defaultWidthX
                  if width != newDefaultWidthX:
                      c.program.insert(0, width - newNominalWidthX)
              newcs[name] = cs[name]
  
      newfont.charset = chrset
      newfont.numGlyphs = len(chrset)
      newfont.strings.strings = glyphOrderStrings + storedNamesStrings
  
      return newcff
  
file_path: catboost/contrib/python/fonttools/fontTools/merge/tables.py
imports: from fontTools import ttLib, cffLib
  from fontTools.misc.psCharStrings import T2WidthExtractor
  from fontTools.ttLib.tables.DefaultTable import DefaultTable
  from fontTools.merge.base import add_method, mergeObjects
  from fontTools.merge.cmap import computeMegaCmap
  from fontTools.merge.util import *
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: merge(m, tables) and returns: newcff