There is a custom font in my app
app_path=\'/home/user1/myapp\'
fname=\'/home/user1/myapp/font/myfont.ttf\'
To setup
Solved the problem like this:
import matplotlib.font_manager as font_manager
font_dirs = ['/my/custom/font/dir', ]
font_files = font_manager.findSystemFonts(fontpaths=font_dirs)
font_list = font_manager.createFontList(font_files)
font_manager.fontManager.ttflist.extend(font_list)
mpl.rcParams['font.family'] = 'My Custom Font'
The fontpaths
kwarg can also be a string in case you only have a single directory to import from.