class_docstr: FreeType font wrapper (requires _imagingft service)
code: def __init__(
      self, font=None, size=10, index=0, encoding="", layout_engine=None
  ):
      # FIXME: use service provider instead
  
      self.path = font
      self.size = size
      self.index = index
      self.encoding = encoding
  
      if layout_engine not in (LAYOUT_BASIC, LAYOUT_RAQM):
          layout_engine = LAYOUT_BASIC
          if core.HAVE_RAQM:
              layout_engine = LAYOUT_RAQM
      elif layout_engine == LAYOUT_RAQM and not core.HAVE_RAQM:
          layout_engine = LAYOUT_BASIC
  
      self.layout_engine = layout_engine
  
      def load_from_bytes(f):
          self.font_bytes = f.read()
          self.font = core.getfont(
              "", size, index, encoding, self.font_bytes, layout_engine
          )
  
      if isPath(font):
          if sys.platform == "win32":
              font_bytes_path = (
                  font if isinstance(font, bytes) else font.encode()
              )
              try:
                  font_bytes_path.decode("ascii")
              except UnicodeDecodeError:
                  # FreeType cannot load fonts with non-ASCII characters on Windows
                  # So load it into memory first
                  with open(font, "rb") as f:
                      load_from_bytes(f)
                  return
          self.font = core.getfont(
              font, size, index, encoding, layout_engine=layout_engine
          )
      else:
          load_from_bytes(font)
  
imports: import os
  import sys
  from .None import Image
  from ._util import isDirectory, isPath, py3
label_desc: Use image node_id 1 to create a new FreeTypeFont object from inherited base classes: object with example: obj = FreeTypeFont(font, size, index, encoding, layout_engine)