Skip to content

Instantly share code, notes, and snippets.

@willprice
Created June 11, 2020 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willprice/69531bd203e60d4987e65f456c3f3247 to your computer and use it in GitHub Desktop.
Save willprice/69531bd203e60d4987e65f456c3f3247 to your computer and use it in GitHub Desktop.
# Snippet from http://jonathansoma.com/lede/data-studio/matplotlib/list-all-fonts-available-in-matplotlib-plus-samples/
# Author: Jonathan Soma
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