Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内鬼生成报错 #14

Open
Zoe-Wh1t3zZ opened this issue Jan 30, 2022 · 1 comment
Open

内鬼生成报错 #14

Zoe-Wh1t3zZ opened this issue Jan 30, 2022 · 1 comment

Comments

@Zoe-Wh1t3zZ
Copy link

File "C:\Users\Administrator\Desktop\HoshinoBot\hoshino\modules\snitchgenerator_init_.py", line 5, in
from .nokia import generate_image
File "C:\Users\Administrator\Desktop\HoshinoBot\hoshino\modules\snitchgenerator\nokia.py", line 21, in
font = ImageFont.truetype("fonts/1.ttf", font_size)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 844, in truetype
return freetype(font)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 841, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 193, in init
self.font = core.getfont(
OSError: cannot open resource

@kcn3388
Copy link

kcn3388 commented Jul 15, 2022

做如下修改:

import os
...

path = os.path.join(os.path.dirname(__file__), "./fonts/1.ttf")
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants