安装 Raqm (Libraqm) Windows 10

2023-11-26

我正在尝试改变方向 of text on an image using pil on python3,但我无法这样做,因为依赖性未安装 libraqm。我找不到安装方法libraqm.


我尝试通过pip安装,但是没有成功。

我也尝试找到它,我找到了,但没有关于如何安装它的说明Windows 10; 仅适用于 Mac 操作系统和 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()

Raises:

文件“C:\Users\Yousef\AppData\Roaming\Python\Python37\site-packages\PIL\ImageFont.py”,第 185 行,在 getmask2 中

大小,偏移量= self.font.getsize(文本,方向,特征,语言)

KeyError:'设置文本方向、语言或字体功能不是 无需 libraqm' 即可支持。


from PIL import Image, ImageDraw, ImageFont, ImageTk, features
print (features.check('raqm'))
print (Image.PILLOW_VERSION)

Returns:

False

6.0.0

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


不实际安装 libraqm 而是让它在 python / PIL 中工作的最简单方法是:

  • 从以下位置下载非官方构建 dllhere(搜索“libraqm”)
  • 将它们复制到与您的目录相同的目录中python.exe

重新启动内核,它应该可以工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

安装 Raqm (Libraqm) Windows 10 的相关文章

随机推荐