Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hellofont/demo.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17 lines (14 sloc)
432 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
# from PIL import ImageFont, ImageDraw, Image | |
# # 定义字体文件路径 | |
# font_file = "D:/font-test/1/3352-0" | |
# # 尝试加载字体 | |
# try: | |
# font = ImageFont.truetype(font_file) | |
# except Exception as e: | |
# print(f"无法加载字体文件 '{font_file}': {e}") | |
# sys.exit(1) | |
# # 读取字体名称 | |
# font_name = font.getname() | |
# print(f"字体名称:{font_name}") | |
shutil.move("wtf.ttf", "demo2.txt") |