code: def get_font_files():
      
      roots = [
          '/usr/share/fonts/truetype',     # where ubuntu puts fonts
          '/usr/share/fonts',              # where fedora puts fonts
          os.path.expanduser('~/.fonts'),  # custom user fonts
          os.path.abspath(os.path.join(os.path.dirname(__file__), 'fonts')),
      ]
      result = {}
      for root in roots:
          for path, dirs, names in os.walk(root):
              for name in names:
                  if name.endswith(('.ttf', '.otf')):
                      result[name[:-4]] = os.path.join(path, name)
      return result
docs: Returns a list of all font files we could find
  
      Returned as a list of dir/files tuples::
  
          get_font_files() -> {'FontName': '/abs/FontName.ttf', ...]
  
      For example::
  
          >>> fonts = get_font_files()
          >>> 'NotoSans-Bold' in fonts
          True
          >>> fonts['NotoSans-Bold'].endswith('/NotoSans-Bold.ttf')
          True