class_docstr: Pen to merge Type 2 CharStrings.
class_docstr_tok: ["Pen","to","merge","Type","2","CharStrings","."]
docstr: We first re-order the master coordinate values.
  For a moveto to lineto, the args are now arranged as::
  
          [ [master_0 x,y], [master_1 x,y], [master_2 x,y] ]
  
  We re-arrange this to::
  
          [       [master_0 x, master_1 x, master_2 x],
                  [master_0 y, master_1 y, master_2 y]
          ]
  
  If the master values are all the same, we collapse the list to
  as single value instead of a list.
  
  We then convert this to::
  
          [ [master_0 x] + [x delta tuple] + [numBlends=1]
            [master_0 y] + [y delta tuple] + [numBlends=1]
          ]
code: def reorder_blend_args(self, commands, get_delta_func):
      """
      We first re-order the master coordinate values.
      For a moveto to lineto, the args are now arranged as::
  
              [ [master_0 x,y], [master_1 x,y], [master_2 x,y] ]
  
      We re-arrange this to::
  
              [	[master_0 x, master_1 x, master_2 x],
                      [master_0 y, master_1 y, master_2 y]
              ]
  
      If the master values are all the same, we collapse the list to
      as single value instead of a list.
  
      We then convert this to::
  
              [ [master_0 x] + [x delta tuple] + [numBlends=1]
                [master_0 y] + [y delta tuple] + [numBlends=1]
              ]
      """
      for cmd in commands:
          # arg[i] is the set of arguments for this operator from master i.
          args = cmd[1]
          m_args = zip(*args)
          # m_args[n] is now all num_master args for the i'th argument
          # for this operation.
          cmd[1] = list(m_args)
      lastOp = None
      for cmd in commands:
          op = cmd[0]
          # masks are represented by two cmd's: first has only op names,
          # second has only args.
          if lastOp in ["hintmask", "cntrmask"]:
              coord = list(cmd[1])
              if not allEqual(coord):
                  raise VarLibMergeError(
                      "Hintmask values cannot differ between source fonts."
                  )
              cmd[1] = [coord[0][0]]
          else:
              coords = cmd[1]
              new_coords = []
              for coord in coords:
                  if allEqual(coord):
                      new_coords.append(coord[0])
                  else:
                      # convert to deltas
                      deltas = get_delta_func(coord)[1:]
                      coord = [coord[0]] + deltas
                      coord.append(1)
                      new_coords.append(coord)
              cmd[1] = new_coords
          lastOp = op
      return commands
  
imports: from collections import namedtuple
  from fontTools.cffLib import maxStackLimit, TopDictIndex, buildOrder, topDictOperators, topDictOperators2, privateDictOperators, privateDictOperators2, FDArrayIndex, FontDict, VarStoreData
  from io import BytesIO
  from fontTools.cffLib.specializer import specializeCommands, commandsToProgram
  from fontTools.ttLib import newTable
  from fontTools import varLib
  from fontTools.varLib.models import allEqual
  from fontTools.misc.roundTools import roundFunc
  from fontTools.misc.psCharStrings import T2CharString, T2OutlineExtractor
  from fontTools.pens.t2CharStringPen import T2CharStringPen
  from functools import partial
  from .errors import VarLibCFFDictMergeError, VarLibCFFPointTypeMergeError, VarLibCFFHintTypeMergeError, VarLibMergeError
label_desc: Use image node_id 12 for calling the CFF2CharStringMergePen obj's underlying member method code with example usage: obj.reorder_blend_args(commands, get_delta_func) and returns: commands