Traceback (most recent call last):
File "C:/python37/pla.py", line 7, in <module>
newfont=ImageFont.truetype('./songti.ttc',60) # Songti.ttc 代表字体,60 代表字号
File "C:\python37\lib\site-packages\PIL\ImageFont.py", line 853, in truetype
return freetype(font)
File "C:\python37\lib\site-packages\PIL\ImageFont.py", line 850, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\python37\lib\site-packages\PIL\ImageFont.py", line 211, in __init__
self.font = core.getfont(font, size, index, encoding, layout_engine=layout_engine)
OSError: cannot open resource
方案:字体文件路径 字体文件名不能改名(保持原名)
- ImageFont resource OSError 方法 cannotimagefont resource oserror方法 resource resolve cannot symbol filenotfoundexception resource because cannot xxx resource cannot class resource because cannot opened directory resource时候cannot imagefont valueerror resource package方法 baseurl方法cannot valid 缓冲区writing方法cannot