This commit is contained in:
이상훈 2024-12-24 16:32:41 +09:00
parent 5e2ecbe419
commit 9442d7e8d1
2 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ os_name = platform.system()
def font_exists(font_name):
return any(font_name in f.name for f in fm.fontManager.ttflist)
font_name = 'NanumGothic'
font_name = 'Nanum Gothic'
if os_name == 'Darwin': # in case of MacOS
if font_exists('AppleGothic'):
font_name = 'AppleGothic'
@ -38,7 +38,7 @@ def install_font(os_name, font_name):
pass
rc('font', family=font_name)
rc('font', family='Nanum Gothic')
plt.rcParams['axes.unicode_minus'] = False

View File

@ -25,7 +25,8 @@ def extract_zip(file_path, extract_to):
def install_fonts(font_dir):
"""Install fonts into macOS Font Book directory."""
font_book_dir = Path.home() / "Library/Fonts"
# font_book_dir = Path.home() / "Library/Fonts"
font_book_dir = "/Library/Fonts"
print(f"Installing fonts to {font_book_dir}...")
for font_file in Path(font_dir).glob("*.ttf"):
shutil.copy(font_file, font_book_dir)