gpt4 book ai didi

python - 安装 Raqm (Libraqm) Windows 10

转载 作者:太空宇宙 更新时间:2023-11-03 23:56:30 62 4
gpt4 key购买 nike

我正在尝试使用上的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

我只是想知道应该如何安装它?任何帮助将不胜感激,谢谢 :)

最佳答案

Libraqm 也有自己的依赖项需要安装。安装 Libraqm 及其依赖项的最简单方法是使用 vcpkg link

这是一个解释如何使用 vcpkg 的视频 video

关于python - 安装 Raqm (Libraqm) Windows 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57545244/

62 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com