123456789101112131415 |
- # -*- coding: utf-8 -*-
- # this is a quick script to ensure that matplotlib can use the fonts
- import importlib.util
- from pathlib import Path
- import shutil
- import glob
- mpl_spec = importlib.util.find_spec("matplotlib")
- mpl_loc = Path(mpl_spec.origin).parent.resolve()
- mpl_fonts_loc = Path.joinpath(mpl_loc, 'mpl-data', 'fonts', 'ttf')
- ttf_files = glob.glob('*.ttf')
- for f in ttf_files:
- shutil.copy(f, mpl_fonts_loc)
|