我正在尝试使用Python3中的PIL更改图像上文本的方向,但由于未安装依赖项libraqm,因此无法实现。我找不到安装libraqm的方法。请注意,需要保留HTML标签。
我尝试通过pip安装它,但是失败了。
我也试图找到它,我找到了,但没有关于如何在Windows 10上安装的说明;只有在Mac OS和Linux上的安装说明。链接是: https://github.com/HOST-Oman/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()
错误提示:
文件 "C:\Users\Yousef\AppData\Roaming\Python\Python37\site-packages\PIL\ImageFont.py",第185行,函数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
我想知道该如何安装它?非常感谢您的帮助,谢谢 :)