class_docstr: Helper to create TextureFont instances and reuse them when possible
class_docstr_tok: ["Helper","to","create","TextureFont","instances","and","reuse","them","when","possible"]
code: def __init__(self, method="cpu"):
      self._fonts = {}
      if not isinstance(method, str) or method not in ("cpu", "gpu"):
          raise ValueError(
              'method must be "cpu" or "gpu", got %s (%s)'
              % (method, type(method))
          )
      if method == "cpu":
          self._renderer = SDFRendererCPU()
      else:  # method == 'gpu':
          self._renderer = SDFRendererGPU()
  
imports: from __future__ import division
  import numpy
  from copy import deepcopy
  import sys
  from ._sdf_gpu import SDFRendererGPU
  from ._sdf_cpu import _calc_distance_field
  from ...gloo import TextureAtlas, IndexBuffer, VertexBuffer
  from ...gloo import context
  from ...gloo.wrappers import _check_valid
  from ...util.fonts import _load_glyph
  from ..transforms import STTransform
  from ...color import ColorArray
  from ..visual import Visual
  from ...io import load_spatial_filters
label_desc: Use image node_id 1 to create a new FontManager object from inherited base classes: object with example: obj = FontManager(method)