我正在使用PowerShell脚本批量将Unicode字符转换为PNG文件。请参见http://pastebin.com/aGJzk4Hh。
我已经弄清楚,要转换"
字符,必须使用指定标签:\"
。
其他特殊字符则不那么简单。
C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) \
-font Arial -pointsize 18 -size 18x26 -gravity center label:"@" \
C:\Users\erics_000\Desktop\Output\Chars\40.png
convert.exe: UnableToAccessPath @ error/property.c/InterpretImageProperties/3330.
convert.exe: NoImagesDefined `C:\Users\erics_000\Desktop\Output\Chars\40.png' @ error/convert.c/ConvertImageCommand/3230.
除此之外还有:
C:\ImageMagick\convert.exe -background transparent -fill hsb(0,0,0) \
-font Arial -pointsize 18 -size 18x26 -gravity center label:"\" \
C:\Users\erics_000\Desktop\Output\Chars\5C.png
convert.exe: NoImagesDefined `label:" C:\Users\erics_000\Desktop\Output\Chars\5C.png' @ error/convert.c/ConvertImageCommand/3230.
这些字符一直给我带来很多问题。
我尝试了所有我知道的用 \
转义这些字符的方法,但是还没有成功。我需要能够转换所有Unicode字符,包括 \
和 @
。
是否已知如何使用ImageMagick将它们转换为PNG文件?
label:"\"
替换为label:" \ "
(注意添加空格!)。同时,将label:"@"
替换为label:" @ "
。 - Kurt Pfeifle