noneplugin / nonebot-plugin-memes

Nonebot2 表情包制作插件
MIT License
230 stars 20 forks source link

使用诺基亚和举牌的时候报错 #13

Closed TaotianZhufang closed 1 year ago

TaotianZhufang commented 2 years ago

使用诺基亚和举牌的时候报错,其他的静图动图都没问题 附上错误信息

09-05 12:46:42 [ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_memes, type=message, priority=12, temp=False> failed. Traceback (most recent call last): File "", line 1, in File "Python38\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "Python38\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "Python38\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "Python38\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, *self._kwargs) File "Python\Python38\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "Python\Python38\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "Python38\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "Python38\lib\asyncio\base_events.py", line 603, in run_until_complete self.run_forever() File "Python38\lib\asyncio\base_events.py", line 570, in run_forever self._run_once() File "Python38\lib\asyncio\base_events.py", line 1859, in _run_once handle._run() File "Python38\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, self._args)

File "Python\Python38\site-packages\nonebot\message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "Python\Python38\site-packages\nonebot\internal\matcher.py", line 672, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "Python\Python38\site-packages\nonebot\internal\matcher.py", line 639, in simple_run await handler( File "Python\Python38\site-packages\nonebot\dependencies__init.py", line 89, in call values = await self.solve(**kwargs) File "Python\Python38\site-packages\nonebot\dependencies\init.py", line 196, in solve value = await field_info._solve(*params) File "Python\Python38\site-packages\nonebot\internal\params.py", line 155, in _solve solved = await task File "Python\Python38\site-packages\nonebot\utils.py", line 111, in _wrapper result = await loop.run_in_executor(None, pfunc) File "Python38\lib\concurrent\futures\thread.py", line 57, in run result = self.fn(self.args, **self.kwargs) File "Python\Python38\site-packages\nonebot_plugin_memes\normal_memes.py", line 294, in raisesign text_img.draw_text( File "Python\Python38\site-packages\nonebot_plugin_imageutils\build_image.py", line 472, in draw_text text2img = Text2Image.from_text( File "Python\Python38\site-packages\nonebot_plugin_imageutils\text2image.py", line 178, in from_text font = get_proper_font(char, style, weight, fontname, fallback_fonts) File "Python\Python38\site-packages\nonebot_plugin_imageutils\fonts.py", line 174, in get_proper_font font = Font.find(family, style, weight, fallback_to_default=False) File "Python\Python38\site-packages\nonebot_plugin_imageutils\fonts.py", line 76, in find font = cls.find_local_font(family) File "Python\Python38\site-packages\nonebot_plugin_imageutils\fonts.py", line 95, in find_local_font return cls(fontname, fontpath) File "Python\Python38\site-packages\nonebot_plugin_imageutils\fonts.py", line 59, in init for table in TTFont(self.path, fontNumber=0)["cmap"].tables: # type: ignore File "Python\Python38\site-packages\fontTools\ttLib\ttFont.py", line 410, in getitem table = self._readTable(tag) File "Python\Python38\site-packages\fontTools\ttLib\ttFont.py", line 417, in _readTable data = self.reader[tag] File "Python\Python38\site-packages\fontTools\ttLib\sfnt.py", line 106, in getitem__ data = entry.loadData (self.file) File "Python\Python38\site-packages\fontTools\ttLib\sfnt.py", line 480, in loadData assert len(data) == self.length AssertionError

MeetWq commented 2 years ago

可能是字体没下好 你检查一下data/fonts文件夹下有没有FZSEJW.ttfFZXS14.ttf这两个字体,有的话检查一下文件大小和仓库里对应的文件是否一致