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","."]
docstr: Read the font from a file, decoding into usable parts.
docstr_tok: ["Read","the","font","from","a","file",",","decoding","into","usable","parts","."]
code: def _read(self, file):
      """
      Read the font from a file, decoding into usable parts.
      """
      rawdata = file.read()
      if not rawdata.startswith(b"\x80"):
          return rawdata
  
      data = b""
      while len(rawdata) > 0:
          if not rawdata.startswith(b"\x80"):
              raise RuntimeError(
                  "Broken pfb file (expected byte 128, "
                  "got %d)" % ord(rawdata[0])
              )
          type = ord(rawdata[1])
          if type in (1, 2):
              (length,) = struct.unpack(str("<i"), rawdata[2:6])
              segment = rawdata[6 : 6 + length]
              rawdata = rawdata[6 + length :]
  
          if type == 1:  # ASCII text: include verbatim
              data += segment
          elif type == 2:  # binary data: encode in hexadecimal
              data += binascii.hexlify(segment)
          elif type == 3:  # end of file
              break
          else:
              raise RuntimeError(
                  "Unknown segment type %d in pfb file" % type
              )
  
      return data
  
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 2 for calling the Type1Font obj's underlying member method code with example usage: obj._read(file) and returns: data, rawdata