Skip to content

Instantly share code, notes, and snippets.

@jsoma
Created July 10, 2018 03:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsoma/424fa5ae1c3b3d462793538bd83de81d to your computer and use it in GitHub Desktop.
Save jsoma/424fa5ae1c3b3d462793538bd83de81d to your computer and use it in GitHub Desktop.
See all of the fonts that matplotlib can access
import matplotlib.font_manager
from IPython.core.display import HTML
def make_html(fontname):
return "<p>{font}: <span style='font-family:{font}; font-size: 24px;'>{font}</p>".format(font=fontname)
code = "\n".join([make_html(font) for font in sorted(set([f.name for f in matplotlib.font_manager.fontManager.ttflist]))])
HTML("<div style='column-count: 2;'>{}</div>".format(code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment