class_docstr: PIL font wrapper
class_docstr_tok: ["PIL","font","wrapper"]
code: def _load_pilfont(self, filename):
      with open(filename, "rb") as fp:
          image = None
          for ext in (".png", ".gif", ".pbm"):
              if image:
                  image.close()
              try:
                  fullname = os.path.splitext(filename)[0] + ext
                  image = Image.open(fullname)
              except Exception:
                  pass
              else:
                  if image and image.mode in ("1", "L"):
                      break
          else:
              if image:
                  image.close()
              msg = "cannot find glyph data file"
              raise OSError(msg)
  
          self.file = fullname
  
          self._load_pilfont_data(fp, image)
          image.close()
  
imports: import base64
  import os
  import sys
  import warnings
  from enum import IntEnum
  from io import BytesIO
  from .None import Image
  from ._util import is_directory, is_path
label_desc: Use image node_id 1 for calling the ImageFont obj's underlying member method code with example usage: obj._load_pilfont(filename) without return types