Created
October 8, 2017 17:43
-
-
Save zmwangx/23cdfc41fd7387013a95c8f684c59bd5 to your computer and use it in GitHub Desktop.
matplotlib patch for using Songti SC (from Songti.ttc) on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py | |
index 9602db7..1ddec34 100644 | |
--- a/lib/matplotlib/font_manager.py | |
+++ b/lib/matplotlib/font_manager.py | |
@@ -66,7 +66,7 @@ except ImportError: | |
from backports.functools_lru_cache import lru_cache | |
-USE_FONTCONFIG = False | |
+USE_FONTCONFIG = True | |
verbose = matplotlib.verbose | |
font_scalings = { | |
@@ -163,7 +163,7 @@ def get_fontext_synonyms(fontext): | |
Return a list of file extensions extensions that are synonyms for | |
the given file extension *fileext*. | |
""" | |
- return {'ttf': ('ttf', 'otf'), | |
+ return {'ttf': ('ttf', 'ttc', 'otf'), | |
'otf': ('ttf', 'otf'), | |
'afm': ('afm',)}[fontext] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment