code: def validate_fonttype(s):
      """
      confirm that this is a Postscript of PDF font type that we know how to
      convert to
      """
      fonttypes = {"type3": 3, "truetype": 42}
      try:
          fonttype = validate_int(s)
      except ValueError:
          try:
              return fonttypes[s.lower()]
          except KeyError:
              raise ValueError(
                  "Supported Postscript/PDF font types are %s"
                  % list(fonttypes)
              )
      else:
          if fonttype not in six.itervalues(fonttypes):
              raise ValueError(
                  "Supported Postscript/PDF font types are %s"
                  % list(six.itervalues(fonttypes))
              )
          return fonttype
  
imports: from __future__ import absolute_import, division, print_function
  import six
  from functools import reduce
  import operator
  import os
  import warnings
  import re
  from matplotlib import cbook, testing
  from matplotlib.cbook import mplDeprecation, deprecated, ls_mapper
  from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  from matplotlib.colors import is_color_like
  from cycler import Cycler, cycler
label_desc: Use image node_id 14 for calling a global function with example usage: validate_fonttype(s) and returns: fonttype, fonttypes