【问题标题】:Installing Raqm (Libraqm) Windows 10安装 Raqm (Libraqm) Windows 10
【发布时间】:2022-02-02 21:43:07
【问题描述】:

我正在尝试使用 上的 pil 更改 图像text方向 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()

加注:

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

size, offset = self.font.getsize(文本、方向、特征、语言)

KeyError: '设置文本方向、语言或字体特征不是 不支持 libraqm'。


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

返回:

错误

6.0.0

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

【问题讨论】:

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


【解决方案1】:

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

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

【讨论】:

【解决方案2】:

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

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

重启你的内核,它应该可以工作了。

【讨论】:

    猜你喜欢
    • 2019-07-12
    • 2021-05-16
    • 2016-08-21
    • 2021-05-01
    • 2016-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多