Spaces:
Sleeping
Sleeping
| # utils/plot_fonts.py | |
| import os | |
| from matplotlib import font_manager, rcParams | |
| def setup_korean_font(project_root, ttf_name="NanumGothic.ttf"): | |
| font_path = os.path.join(project_root, ttf_name) | |
| if os.path.exists(font_path): | |
| font_manager.fontManager.addfont(font_path) | |
| rcParams["font.family"] = font_manager.FontProperties(fname=font_path).get_name() | |
| else: | |
| rcParams["font.family"] = ["NanumGothic", "AppleGothic", "Malgun Gothic", "DejaVu Sans"] | |
| rcParams["axes.unicode_minus"] = False |