--- lib/matplotlib/font_manager.py 2009/11/12 17:27:34 7952
+++ lib/matplotlib/font_manager.py 2009/11/12 17:28:22 7953
see license/LICENSE_TTFQUERY.
+import os, sys, glob, subprocess
grab all of the fonts the user wants to be made available to
applications, without needing knowing where all of them reside.
fontext = get_fontext_synonyms(fontext)
- status, output = commands.getstatusoutput("fc-list file")
+ pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE)
+ output = pipe.communicate()[0]
+ if pipe.returncode == 0:
for line in output.split('\n'):
fname = line.split(':')[0]
if (os.path.splitext(fname)[1][1:] in fontext and
def fc_match(pattern, fontext):
fontexts = get_fontext_synonyms(fontext)
- status, output = commands.getstatusoutput('fc-match -sv "%s"' % pattern)
+ pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE)
+ output = pipe.communicate()[0]
+ if pipe.returncode == 0:
for match in _fc_match_regex.finditer(output):
if os.path.splitext(file)[1][1:] in fontexts: