code: def print_glyphs(path):
      """
      Print the all glyphs in the given font file to stdout.
  
      Parameters
      ----------
      path : str or None
          The path to the font file.  If None, use Matplotlib's default font.
      """
      if path is None:
          path = fm.findfont(fm.FontProperties())  # The default font.
  
      font = FT2Font(path)
  
      charmap = font.get_charmap()
      max_indices_len = len(str(max(charmap.values())))
  
      print("The font face contains the following glyphs:")
      for char_code, glyph_index in charmap.items():
          char = chr(char_code)
          name = unicodedata.name(
              char,
              f"{char_code:#x} ({font.get_glyph_name(glyph_index)})",
          )
          print(f"{glyph_index:>{max_indices_len}} {char} {name}")
  
file_path: matplotlib/galleries/examples/text_labels_and_annotations/font_table.py
imports: import os
  from pathlib import Path
  import unicodedata
  import matplotlib.pyplot
  import matplotlib.font_manager
  from matplotlib.ft2font import FT2Font
label_desc: Use image node_id 1 for calling a global function with example usage: print_glyphs(path) without return types