Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d08d339

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1751
1 parent 76ce690 commit d08d339

2 files changed

Lines changed: 16 additions & 21 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
New entries should be added at the top
22

3+
2005-09-14 font_manager.py: removed chkfontpath from x11FontDirectory() - SC
4+
35
2005-09-14 Factored out auto date locator/formatter factory code into
46
matplotlib.date.date_ticker_factory
57

6-
2005-09-13 Added Mark's axes positions history patch #1286915
8+
2005-09-13 Added Mark's axes positions history patch #1286915
79

810
2005-09-09 Added support for auto canvas resizing with
911
fig.set_figsize_inches(9,5,forward=True) # inches
1012
OR
1113
fig.resize(400,300) # pixels
1214

13-
1415
2005-09-07 figure.py: update Figure.draw() to use the updated
1516
renderer.draw_image() so that examples/figimage_demo.py works again.
1617
examples/stock_demo.py: remove data_clipping (which no longer

lib/matplotlib/font_manager.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@
6262
X11FontDirectories = [
6363
# what seems to be the standard installation point
6464
"/usr/X11R6/lib/X11/fonts/TTF/",
65+
# documented as a good place to install new fonts...
66+
"/usr/share/fonts/",
6567
# common application, not really useful
6668
"/usr/lib/openoffice/share/fonts/truetype/",
67-
# documented as a good place to install new fonts...
68-
"/usr/share/fonts/"]
69+
]
6970

7071
OSXFontDirectories = [
7172
"/Library/Fonts/",
@@ -164,24 +165,17 @@ def OSXInstalledFonts(directory=None, fontext=None):
164165

165166
def x11FontDirectory():
166167
"""Return the system font directories for X11."""
168+
fontpaths = []
169+
def add(arg,directory,files):
170+
fontpaths.append(directory)
167171

168-
chkfont = '/usr/sbin/chkfontpath'
169-
if os.path.isfile(chkfont):
170-
fontpaths = os.popen(chkfont).readlines()
171-
return [p.split(':')[1].strip() for p in fontpaths if \
172-
p.find(': /') >= 0]
173-
else:
174-
fontpaths = []
175-
#def add(arg, directory, files):
176-
def add(arg,directory,files):
177-
fontpaths.append(directory)
178-
for fontdir in X11FontDirectories:
179-
try:
180-
if os.path.isdir(fontdir):
181-
os.path.walk(fontdir, add, None)
182-
except (IOError, OSError, TypeError, ValueError):
183-
pass
184-
return fontpaths
172+
for fontdir in X11FontDirectories:
173+
try:
174+
if os.path.isdir(fontdir):
175+
os.path.walk(fontdir, add, None)
176+
except (IOError, OSError, TypeError, ValueError):
177+
pass
178+
return fontpaths
185179

186180
def findSystemFonts(fontpaths=None, fontext='ttf'):
187181

0 commit comments

Comments
 (0)