2013-05-20 104 views
1

我看到imagemagick的更新版本support right-to-left scripts such as Hebrew and Arabic。细手册提到了direction标志,但没有提供任何法律论据的例子。不接受明显的猜测,如rtlreverseright-to-left。什么是direction国旗的法律论据?从ImageMagick的从右到左的文本

$ echo "שלום, עולם" | convert -background white -fill black -font Arial -direction reverse -pointsize 20 label:@- hello.png 
convert.im6: unrecognized direction type `reverse' @ error/convert.c/ConvertImageCommand/1227. 

$ convert --version 
Version: ImageMagick 6.7.7-10 2012-08-17 Q16 http://www.imagemagick.org 
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC 
Features: OpenMP 

回答

1

参数应该是right-to-left。我尝试了以下命令的ImageMagick 6.8.5-7(在Windows上)和它的工作:

convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" A2G_reversed2.png 

convert -version 
Version: ImageMagick 6.8.5-7 2013-05-19 Q16 http://www.imagemagick.org 
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC 
Features: DPC OpenMP 
+1

谢谢你。它仍然不适用于我的系统,但至少我现在知道正确的语法。 – dotancohen

4

选项-direction right-to-left不会为阿拉伯语/波斯语工作。 ImageMagick中的right-to-left不适用于阿拉伯语等连接词/格式化语言。

我不知道其他从右到左的语言,如乌尔都语,但我相信你可能想要重塑文本之前传递给ImageMagick。对于JavaBetter-Arabic-Reshaper),Pythonarabic_reshaper)。

3

对于带有ImageMagic的阿拉伯语文本,可以使用“caption:”和“label:”,并使用“-direction right-to-left”。但是,这会为独立字符选择字形,而不是联合字符。

最简单的解决方案似乎是“pango:”,其中“-direction right-to-left”不需要。

转换-gravity中心-size 200x200的 - 填充黑色-font宋体-pointsize 50攀高: “سلام” arabic_r5.png

OR

转换-gravity中心-size 200x200的 - 填充黑色-font宋体-pointsize 50攀高:@ utftext.txt arabic_r5.png

enter image description here

来源:http://multipole.org/discourse-server/viewtopic.php?f=1&t=26611