我正在尝试使用上的pil更改图像上文本的方向 python3,但我无法这样做,因为未安装dependency libraqm。我找不到安装 libraqm 的方法。
我尝试通过 pip 安装它,但没有成功。
我也试图找到它,我找到了,但是没有关于如何在 Windows 10 上安装它的说明; 仅适用于 Mac OS 和 Linux。链接是: https://github.com/HOST-Oman/libraqm/
from PIL import Image, ImageDraw, ImageFont, ImageTk, features
Coords = [0,0]
Text = 'Hello World'
colour = '#225643'
Font = ImageFont.truetype("Font/GentiumBasic-Regular.ttf", 40,
encoding="unic"))
direction = 'rtl' #Right to Left
Alignment= 'right'
til = Image.new("RGBA", (800, 500))
draw = ImageDraw.Draw(til)
draw.text(Coords, Text, colour, font=Fonts,
align=Alignment, direction=direction)
til.show()
加注:
File "C:\Users\Yousef\AppData\Roaming\Python\Python37\site-packages\PIL\ImageFont.py", line 185, in getmask2
size, offset = self.font.getsize(text, direction, features, language)
KeyError: 'setting text direction, language or font features is not supported without libraqm'.
from PIL import Image, ImageDraw, ImageFont, ImageTk, features
print (features.check('raqm'))
print (Image.PILLOW_VERSION)
返回:
False
6.0.0
我只是想知道应该如何安装它?任何帮助将不胜感激,谢谢 :)
最佳答案
关于python - 安装 Raqm (Libraqm) Windows 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57545244/