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.
  
  decrypted : bytes
      The decrypted form of ``parts[1]``.
  
  prop : dict[str, Any]
      A dictionary of font properties. Noteworthy keys include:
  
      - FontName: PostScript name of the font
      - Encoding: dict from numeric codes to glyph names
      - FontMatrix: bytes object encoding a matrix
      - UniqueID: optional font identifier, dropped when modifying the font
      - CharStrings: dict from glyph names to byte code
      - Subrs: array of byte code subroutines
      - OtherSubrs: bytes object encoding some PostScript code
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",".","decrypted",":","bytes","The","decrypted","form","of","``","parts","[","1","]","``",".","prop",":","dict","[","str",",","Any","]","A","dictionary","of","font","properties",".","Noteworthy","keys","include",":","-","FontName",":","PostScript","name","of","the","font","-","Encoding",":","dict","from","numeric","codes","to","glyph","names","-","FontMatrix",":","bytes","object","encoding","a","matrix","-","UniqueID",":","optional","font","identifier",",","dropped","when","modifying","the","font","-","CharStrings",":","dict","from","glyph","names","to","byte","code","-","Subrs",":","array","of","byte","code","subroutines","-","OtherSubrs",":","bytes","object","encoding","some","PostScript","code"]
docstr: Encrypt plaintext using the Type-1 font algorithm.
  
  The algorithm is described in Adobe's "Adobe Type 1 Font Format".
  The key argument can be an integer, or one of the strings
  'eexec' and 'charstring', which map to the key specified for the
  corresponding part of Type-1 fonts.
  
  The ndiscard argument should be an integer, usually 4. That
  number of bytes is prepended to the plaintext before encryption.
  This function prepends NUL bytes for reproducibility, even though
  the original algorithm uses random bytes, presumably to avoid
  cryptanalysis.
code: def _encrypt(plaintext, key, ndiscard=4):
      """
      Encrypt plaintext using the Type-1 font algorithm.
  
      The algorithm is described in Adobe's "Adobe Type 1 Font Format".
      The key argument can be an integer, or one of the strings
      'eexec' and 'charstring', which map to the key specified for the
      corresponding part of Type-1 fonts.
  
      The ndiscard argument should be an integer, usually 4. That
      number of bytes is prepended to the plaintext before encryption.
      This function prepends NUL bytes for reproducibility, even though
      the original algorithm uses random bytes, presumably to avoid
      cryptanalysis.
      """
  
      key = _api.check_getitem(
          {"eexec": 55665, "charstring": 4330}, key=key
      )
      ciphertext = []
      for byte in b"\0" * ndiscard + plaintext:
          c = byte ^ (key >> 8)
          ciphertext.append(c)
          key = ((key + c) * 52845 + 22719) & 0xFFFF
  
      return bytes(ciphertext)
  
imports: import binascii
  import functools
  import logging
  import re
  import string
  import struct
  import numpy
  from matplotlib.cbook import _format_approx
  from .None import _api
label_desc: Use image node_id 5 for calling the Type1Font obj's underlying member method code with example usage: obj._encrypt(plaintext, key, ndiscard) and returns: bytes