Python matplotlib.font_manager.findSystemFonts() Examples

The following are 2 code examples of matplotlib.font_manager.findSystemFonts(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module matplotlib.font_manager , or try the search function .
Example #1
Source File: japanize_matplotlib.py    From japanize-matplotlib with MIT License 5 votes vote down vote up
def japanize():
    font_dir_path = get_font_path()
    font_dirs = [font_dir_path]
    font_files = font_manager.findSystemFonts(fontpaths=font_dirs)
    font_list = font_manager.createFontList(font_files)
    font_manager.fontManager.ttflist.extend(font_list)
    matplotlib.rc('font', family=FONT_NAME) 
Example #2
Source File: utils.py    From keras-vis with MIT License 5 votes vote down vote up
def _find_font_file(query):
    """Utility to find font file.
    """
    return list(filter(lambda path: query.lower() in os.path.basename(path).lower(), fontman.findSystemFonts()))