code: def fonts(pattern="*"):
      """
      Queries ImageMagick library for available fonts.
  
      Available fonts can be configured by defining `types.xml`,
      `type-ghostscript.xml`, or `type-windows.xml`.
      Use :func:`wand.version.configure_options` to locate system search path,
      and `resources <http://www.imagemagick.org/script/resources.php>`_
      article for defining xml file.
  
      Example: List all bold Helvetica fonts::
  
          >>> from wand.version import fonts
          >>> fonts('*Helvetica*Bold*')
          ['Helvetica-Bold', 'Helvetica-Bold-Oblique', 'Helvetica-BoldOblique',
           'Helvetica-Narrow-Bold', 'Helvetica-Narrow-BoldOblique']
  
  
      :param pattern: A term to filter queries against. Supports wildcard '*'
                      characters. Default patterns '*' for all options.
      :type pattern: :class:`basestring`
      :returns: Sequence of matching fonts
      :rtype: :class:`collections.Sequence`
      """
      if not isinstance(pattern, string_type):
          raise TypeError(
              "pattern must be a string, not " + repr(pattern)
          )
      # We must force init environment to load user config paths.
      library.MagickWandGenesis()
      pattern_p = ctypes.create_string_buffer(binary(pattern))
      number_fonts = ctypes.c_size_t(0)
      fonts = []
      fonts_p = library.MagickQueryFonts(
          pattern_p, ctypes.byref(number_fonts)
      )
      for cursor in range(number_fonts.value):
          font = ctypes.string_at(fonts_p[cursor])
          fonts.append(text(font))
      if fonts_p:
          fonts_p = library.MagickRelinquishMemory(fonts_p)
      return fonts
  
file_path: wand/wand/version.py
imports: from __future__ import print_function
  import ctypes
  import datetime
  import re
  import sys
  from .compat import binary, string_type, text
label_desc: Use image node_id 2 for calling a global function with example usage: fonts(pattern) and returns: fonts