【问题标题】:Imagemagick convert with font HelveticaImagemagick 转换为 Helvetica 字体
【发布时间】:2017-04-05 22:27:43
【问题描述】:

我正在尝试使用这种字体创建文本:HelveticaNeueLTStd-Roman

如果我这样做,字体会在我的 Imagick 中列出:identify -list font

...
 Font: HelveticaNeueLTStd-Roman
 family: HelveticaNeueLTStd-Roman
 style: Normal
 stretch: Normal
 weight: 400
 glyphs: c:\windows\fonts\helveticaneueltstd-roman_0.otf
 ...

我的命令如下所示:

convert -debug annotate -size 720x576 -background none -fill white -stroke white 
-font HelveticaNeueLTStd-Roman -pointsize 22 90x25 -draw "text 160,420 'Test 1'" 
-font HelveticaNeueLTStd-Roman -pointsize 22 50x25 -draw "text 310,420 'Text 2'" 
-font HelveticaNeueLTStd-Roman -pointsize 22 115x25 -draw "text 425,420 'Text 3'" result.png

但我收到以下错误(cmd):

 convert -debug annotate -size 720x576 -background none -fill white -stroke white -font HelveticaNeueLTStd-Roman -pointsize 22 90x25 -draw "text 160,420 'Test 1'" -font HelveticaNeueLTStd-Roman -pointsize 22
 50x25 -draw "text 310,420 'Text 2'" -font HelveticaNeueLTStd-Roman
 -pointsize 22 115x25 -draw "text 425,420 'Text 3'" result.png
 convert.exe: unable to open image `90x25': No such file or directory @ error/blob.c/OpenBlob/2702.
 convert.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
 convert.exe: unable to open image `50x25': No such file or directory @ error/blob.c/OpenBlob/2702.
 convert.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
 convert.exe: unable to open image `115x25': No such file or directory @ error/blob.c/OpenBlob/2702.
 convert.exe: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
 convert.exe: no images defined `result.png' @ error/convert.c/ConvertImageCommand/3252.

我做错了什么?

【问题讨论】:

    标签: image fonts command imagemagick imagemagick-convert


    【解决方案1】:

    试试这个:

    magick convert -size 720x576 xc:none -fill white -stroke white 
    -font Arial -pointsize 22 -draw "text 160,420 'Test 1'" 
    -font Arial -pointsize 22 -draw "text 310,420 'Text 2'" 
    -font Arial -pointsize 22 -draw "text 425,420 'Text 3'" result.png
    

    我已将 Helvetica 更改为 Arial 并使用 IMv7 语法。不过应该很容易调整。

    【讨论】:

      【解决方案2】:

      -pointsize 设置只需要 ONE 参数(点大小),而不是像你那样的 TWO

      此外,-font-pointsize 实际上是设置,因此无需重复它们 - 在更改之前它们会保持设置。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-06-23
        • 2011-08-22
        • 2011-12-28
        • 2015-12-02
        • 2014-12-10
        • 2019-01-23
        • 2011-03-21
        相关资源
        最近更新 更多