Only supported for TrueType fonts
时间: 2023-11-05 21:47:08 浏览: 16
This error message usually appears when you are trying to use a font format that is not supported by the application or system you are using. TrueType is a font format that is widely used and supported by most applications and systems.
If you encounter this error message, you can try converting your font to TrueType format using a font converter tool. Alternatively, you can try using a different font that is already in TrueType format.
相关问题
pycharm Only supported for TrueType fonts
这是一个错误信息,它意味着 PyCharm 只支持 TrueType 字体。如果您想在 PyCharm 中使用其他类型的字体,您需要将它们转换为 TrueType 字体格式。您可以使用一些免费或付费的字体转换工具来完成这项任务。但是,如果您不需要更改字体,您可以尝试在 PyCharm 的设置中更改字体,以找到一个适合您的 TrueType 字体。
怎么解决Only supported for TrueType fonts
这个错误通常出现在PIL库的ImageDraw模块中,当尝试使用不受支持的字体格式时会出现这个错误。错误信息建议只支持TrueType字体。
要解决这个错误,你可以尝试使用TrueType字体而不是当前使用的字体格式。你可以使用PIL中的`ImageFont.truetype()`方法来指定TrueType字体。下面是一个例子:
```python
from PIL import Image, ImageDraw, ImageFont
# 指定 TrueType 字体
font = ImageFont.truetype('arial.ttf', size=20)
# 在图像上绘制文本
image = Image.new('RGB', (100, 100), color='white')
draw = ImageDraw.Draw(image)
draw.text((10, 10), 'Hello, World!', fill='black', font=font)
image.show()
```
在这个例子中,我们使用`ImageFont.truetype()`方法指定了一个TrueType字体,其中我们传递了字体文件路径和字体大小。你可以将`'arial.ttf'`替换为你想要使用的TrueType字体文件的路径。
阅读全文
相关推荐







