Closed coder-tq closed 1 year ago
系统centos7,字体Noto Color Emoji.ttf
字体有问题,不能用SVG的字体
我可以在哪里下载到非svg版本的Noto Color Emoji字体呢
https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf
02-19 14:01:30 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_memes) failed. Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 188, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 727, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 702, in simple_run await handler( File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 104, in call values = await self.solve(kwargs) File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 219, in solve values = await asyncio.gather( File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 208, in _solve_field value = await cast(Param, field.field_info)._solve(params) File "/usr/local/lib/python3.10/site-packages/nonebot/internal/params.py", line 148, in _solve return await task File "/usr/local/lib/python3.10/site-packages/nonebot/utils.py", line 113, in _wrapper result = await loop.run_in_executor(None, pfunc) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_memes/normal_memes.py", line 317, in raisesign text_img.draw_text( File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_imageutils/build_image.py", line 479, in draw_text text2img = Text2Image.from_text( File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_imageutils/text2image.py", line 201, in from_text chars.append(Char(char, font, fontsize, fill, stroke_width, stroke_fill)) File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_imageutils/text2image.py", line 34, in init self.pilfont = self.font.load_font(fontsize) File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_imageutils/fonts.py", line 147, in load_font return ImageFont.truetype(str(self.path), fontsize, encoding="utf-8") File "/usr/local/lib/python3.10/site-packages/PIL/ImageFont.py", line 1008, in truetype return freetype(font) File "/usr/local/lib/python3.10/site-packages/PIL/ImageFont.py", line 1005, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/usr/local/lib/python3.10/site-packages/PIL/ImageFont.py", line 255, in init self.font = core.getfont( OSError: invalid pixel size
变成新的报错了
你的字体是怎么装的?名字有没有改过?
改过字体文件的名字与配置中一致,丢到/data/fonts文件夹
invalid pixel size
https://github.com/python-pillow/Pillow/issues/6166 找到了相关的issue,我需要修改什么么
字体名需要是 NotoColorEmoji.ttf
emoji标签会出现这个报错 02-19 12:00:01 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_memes) failed. Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)