能否在图像Magick使用老家 f?
我已尝试过我能够想到的一切,似乎没有任何工作。 我做了很多的搜索,我似乎找不到任何事情来处理这一具体问题。
我最终使用购买力平价,但我也尝试在指挥线上使用图像Magick,但没有成功。 我正在使用图象6.7.6。 在这方面,我迄今为止做了些什么。
- I have tested the fonts that ImageMagick reckognizes using the
identify -list font
command - I have manually created a type.xml file based on the xml files that came installed on my system
- I have created a type.xml file using this script: imagick_type_gen
- I have tested with multiple font types: ttf, otf, pfb, ttc
下面是某些字体的<代码>识别-list font的样本输出。 我测试了:
Font: DejaVu-Sans-Book
family: DejaVu Sans
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/dejavu/DejaVuSans.ttf
Font: Baskerville-Regular
family: Baskerville
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/custom/Baskerville.ttc
Font: Palatino-Roman
family: Palatino
style: Normal
stretch: Normal
weight: 400
glyphs: /usr/share/fonts/urw-fonts/p052003l.pfb
Font: Honey-Script-Light
family: Honey Script
style: Normal
stretch: Normal
weight: 300
glyphs: /usr/share/fonts/custom/HoneyScript-Light.ttf
If I specify the full font name everything works as expected:
convert -pointsize 32 -font "Honey-Script-Light" label: Testing testing.png
However, when I try to use the font family (both listed by identify -list font
and listed in type.xml) I get the default system font:
convert -pointsize 32 -family "Honey Script" label: Testing testing.png
I have also tried specifying all of the font s parameters and it again does not work:
convert -pointsize 32 -stretch Normal -style Normal -weight 300 -family "Honey Script" label: Testing testing.png
When I do a similar process through PHP, it actually returns an error as soon as I try to set the font family of the draw object.
$draw->setFontFamily( Honey Script );
出现这一错误:
PHP Fatal error: Uncaught exception ImagickDrawException with message Unable to set font family; parameter not found in the list of configured fonts
Just like the command line option, if I specify the full font name, the image is rendered properly.
$draw->setFont( Honey-Script-Light );
From everything I have found about how to configure a font to be used with ImageMagick, the fonts are indeed configured. Why can t I select the fonts based on the font family?
Is this possibly an undocumented bug? Is there something I am missing?
我认识到,我可以简单地说明全方位的名声,并且可以这样做,但我的项目有一个具体理由,使更能具体地说明老家。
如果自己不工作,为什么要具体指明老年家庭? 这正是Magick在老年家庭选择方面所说的:
This setting suggests a font family that ImageMagick should try to use for rendering text. If the family can be found it is used; if not, a default font (e.g., "Arial") or a family known to be similar is substituted (e.g., "Courier" might be used if "System" is requested but not found).
任何想法都受到欢迎。 此时此刻,我非常 st。
EDIT:
The main reason I would prefer to use font families rather than fully named fonts is because of the input I am processing. I receive files from a third party that need to be processed. These files specify fonts as:
font-family="Honey Script" font-style="Normal" font-stretch="Normal" font-weight="300"
如果我不得不根据这一信息具体说明确切的名词,那么我就需要为真实姓名的亲子家庭和属性的各种可能组合绘制一份地图。 由于该系统增加了数百个字体,因此很难维持。
在我看来,必须有一种办法,根据上文所列有关字体的所有现有细节,使图像Magick能够检索准确的字体。
如果无法做到这一点,那么,为什么成像会有什么选择来具体指明老年家庭?