Skip to content

Merge OSXInstalledFonts into findSystemFonts. #12219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/next_api_changes/2018-08-17-AL-deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ The following API elements are deprecated:
- ``get_py2exe_datafiles``, ``tk_window_focus``,
- ``backend_ps.PsBackendHelper``, ``backend_ps.ps_backend_helper``,
- ``cbook.iterable``,
- ``font_manager.OSXInstalledFonts``,
- ``mlab.demean``,
6 changes: 3 additions & 3 deletions lib/matplotlib/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
return None


@cbook.deprecated("3.1")
def OSXInstalledFonts(directories=None, fontext='ttf'):
"""Get list of font files on OS X."""
if directories is None:
Expand Down Expand Up @@ -263,10 +264,9 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
fontfiles.update(win32InstalledFonts(fontext=fontext))
else:
fontpaths = X11FontDirectories
fontfiles.update(get_fontconfig_fonts(fontext))
# check for OS X & load its fonts if present
if sys.platform == 'darwin':
fontfiles.update(OSXInstalledFonts(fontext=fontext))
fontpaths = [*X11FontDirectories, *OSXFontDirectories]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new list expansions are nice, but this is just fontpaths += OSXFontDirectories, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to overwrite the global X11FontsDirectories in place... (I guess I could do a copy above instead if you prefer.)

fontfiles.update(get_fontconfig_fonts(fontext))

elif isinstance(fontpaths, str):
fontpaths = [fontpaths]
Expand Down