Skip to content

Instantly share code, notes, and snippets.

@uchida
Created March 3, 2012 11:18
Show Gist options
  • Select an option

  • Save uchida/1965578 to your computer and use it in GitHub Desktop.

Select an option

Save uchida/1965578 to your computer and use it in GitHub Desktop.
show available font names for matplotlib
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
from matplotlib import get_configdir
import pickle
fpath = os.path.join(get_configdir(), 'fontList.cache')
with open(fpath, 'r') as f:
fontmgr = pickle.load(f)
for fontentry in fontmgr.ttflist:
print fontentry.name
for fontentry in fontmgr.afmlist:
print fontentry.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment