Created
March 3, 2012 11:18
-
-
Save uchida/1965578 to your computer and use it in GitHub Desktop.
show available font names for matplotlib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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