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

Skip to content

Commit 8d66b47

Browse files
authored
Merge pull request #12219 from anntzer/osxinstalledfonts
Merge OSXInstalledFonts into findSystemFonts.
2 parents d03e4ac + 51c4c05 commit 8d66b47

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
@@ -207,6 +207,7 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
207207
return list(items)
208208

209209

210+
@cbook.deprecated("3.1")
210211
def OSXInstalledFonts(directories=None, fontext='ttf'):
211212
"""Get list of font files on OS X."""
212213
if directories is None:
@@ -261,10 +262,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
261262
fontfiles.update(win32InstalledFonts(fontext=fontext))
262263
else:
263264
fontpaths = X11FontDirectories
264-
fontfiles.update(get_fontconfig_fonts(fontext))
265-
# check for OS X & load its fonts if present
266265
if sys.platform == 'darwin':
267-
fontfiles.update(OSXInstalledFonts(fontext=fontext))
266+
fontpaths = [*X11FontDirectories, *OSXFontDirectories]
267+
fontfiles.update(get_fontconfig_fonts(fontext))
268268

269269
elif isinstance(fontpaths, str):
270270
fontpaths = [fontpaths]

0 commit comments

Comments
 (0)