class_docstr: A class representing a Type-1 font, for use by backends.
  
  Attributes
  ----------
  parts : tuple
      A 3-tuple of the cleartext part, the encrypted part, and the finale of
      zeros.
  
  prop : Dict[str, Any]
      A dictionary of font properties.
class_docstr_tok: ["A","class","representing","a","Type-1","font",",","for","use","by","backends",".","Attributes","--","--","--","--","--","parts",":","tuple","A","3-tuple","of","the","cleartext","part",",","the","encrypted","part",",","and","the","finale","of","zeros",".","prop",":","Dict","[","str",",","Any","]","A","dictionary","of","font","properties","."]
code: def _transformer(cls, tokens, slant, extend):
      def fontname(name):
          result = name
          if slant:
              result += b"_Slant_" + str(int(1000 * slant)).encode(
                  "ascii"
              )
          if extend != 1.0:
              result += b"_Extend_" + str(int(1000 * extend)).encode(
                  "ascii"
              )
          return result
  
      def italicangle(angle):
          return str(
              float(angle) - np.arctan(slant) / np.pi * 180
          ).encode("ascii")
  
      def fontmatrix(array):
          array = array.lstrip(b"[").rstrip(b"]").split()
          array = [float(x) for x in array]
          oldmatrix = np.eye(3, 3)
          oldmatrix[0:3, 0] = array[::2]
          oldmatrix[0:3, 1] = array[1::2]
          modifier = np.array(
              [[extend, 0, 0], [slant, 1, 0], [0, 0, 1]]
          )
          newmatrix = np.dot(modifier, oldmatrix)
          array[::2] = newmatrix[0:3, 0]
          array[1::2] = newmatrix[0:3, 1]
          as_string = "[" + " ".join(str(x) for x in array) + "]"
          return as_string.encode("latin-1")
  
      def replace(fun):
          def replacer(tokens):
              token, value = next(tokens)  # name, e.g., /FontMatrix
              yield bytes(value)
              token, value = next(tokens)  # possible whitespace
              while token is cls._whitespace:
                  yield bytes(value)
                  token, value = next(tokens)
              if value != b"[":  # name/number/etc.
                  yield bytes(fun(value))
              else:  # array, e.g., [1 2 3]
                  result = b""
                  while value != b"]":
                      result += value
                      token, value = next(tokens)
                  result += value
                  yield fun(result)
  
          return replacer
  
      def suppress(tokens):
          for x in itertools.takewhile(
              lambda x: x[1] != b"def", tokens
          ):
              pass
          yield b""
  
      table = {
          b"/FontName": replace(fontname),
          b"/ItalicAngle": replace(italicangle),
          b"/FontMatrix": replace(fontmatrix),
          b"/UniqueID": suppress,
      }
  
      for token, value in tokens:
          if token is cls._name and value in table:
              for value in table[value](
                  itertools.chain([(token, value)], tokens)
              ):
                  yield value
          else:
              yield value
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/type1font.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import binascii
  import io
  import itertools
  import re
  import struct
  import numpy
label_desc: Use image node_id 6 for calling the Type1Font obj's underlying member method code with example usage: obj._transformer(cls, tokens, slant, extend) and returns: result, str, as_string, replacer