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

Skip to content

Commit 51c4c05

Browse files
committed
Merge OSXInstalledFonts into findSystemFonts.
There isn't much of a point of reproducing the logic of findSystemFonts into OSXInstalledFonts just with a different list of directories.
1 parent 99eea61 commit 51c4c05

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/api/next_api_changes/2018-08-17-AL-deprecations.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ The following API elements are deprecated:
66
- ``get_py2exe_datafiles``, ``tk_window_focus``,
77
- ``backend_ps.PsBackendHelper``, ``backend_ps.ps_backend_helper``,
88
- ``cbook.iterable``,
9+
- ``font_manager.OSXInstalledFonts``,
910
- ``mlab.demean``,

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
209209
return None
210210

211211

212+
@cbook.deprecated("3.1")
212213
def OSXInstalledFonts(directories=None, fontext='ttf'):
213214
"""Get list of font files on OS X."""
214215
if directories is None:
@@ -263,10 +264,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
263264
fontfiles.update(win32InstalledFonts(fontext=fontext))
264265
else:
265266
fontpaths = X11FontDirectories
266-
fontfiles.update(get_fontconfig_fonts(fontext))
267-
# check for OS X & load its fonts if present
268267
if sys.platform == 'darwin':
269-
fontfiles.update(OSXInstalledFonts(fontext=fontext))
268+
fontpaths = [*X11FontDirectories, *OSXFontDirectories]
269+
fontfiles.update(get_fontconfig_fonts(fontext))
270270

271271
elif isinstance(fontpaths, str):
272272
fontpaths = [fontpaths]

0 commit comments

Comments
 (0)