(args, curr_pos, cmd)
return new_args
Converts given args to relative values.
Converts given args to relative values.
Converts given args to relative values .
def _convert_args(args, curr_pos, cmd):
  """Converts given args to relative values."""
  # NOTE: glyphs only use a very small subset of commands (L, C, M, and Z -- I
  # believe). So I'm not handling A and H for now.
  if cmd in 'AH':
    raise NotImplementedError('These commands have >6 args (not supported).')

  new_args = []
  for i, arg in enumerate(args):
    x_or_y = i % 2
    if cmd == 'H':
      x_or_y = (i + 1) % 2
    new_args.append(str(float(arg) - curr_pos[x_or_y]))

  return new_args
def _convert_args ( args , curr_pos , cmd ) : # NOTE: glyphs only use a very small subset of commands (L, C, M, and Z -- I # believe). So I'm not handling A and H for now. if cmd in 'AH' : raise NotImplementedError ( 'These commands have >6 args (not supported).' ) new_args = [ ] for i , arg in enumerate ( args ) : x_or_y = i % 2 if cmd == 'H' : x_or_y = ( i + 1 ) % 2 new_args . append ( str ( float ( arg ) - curr_pos [ x_or_y ] ) ) return new_args