Spaces:
Sleeping
Sleeping
File size: 522 Bytes
038bcc6 |
1 2 3 4 5 6 7 8 9 10 11 12 |
# 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 |