python - 安装 Raqm (Libraqm) Windows 10

标签 python python-3.x installation dependencies python-imaging-library

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

相关文章:

python - 我可以使 Django 数据库路径(对于 sqlite3)为 "cross-platform"吗?

python - Django Rest Framework 用户名/密码无效

Python 代码在 2.7 中有效,但在 3.5 中无效

python-3.x - 从 .pdftypes 导入 PDFObjectNotFound ImportError : cannot import name 'PDFObjectNotFound'

python - PyGraphviz 只是没有安装在 OS-X 10.9.4 中

python - 在 PyObjC 中,如何在使用 runModalForWindow_ 后让工作表结束?

python - 如何在下一个 jupyter 单元格中重复使用 plot

python - 编写需要用户名和密码的 Python 功能测试

Python - 在 Mac OSX Snow Leopard 中安装 matplotlib

installation - 使用 iTunes 12 安装 IPA