ImageMagick使用我的真字体(Magick++)转换SVG
ImageMagick convert SVG using my true type font (Magick++)
我正在使用ImageMagick
的Magick++
API。我找不到如何设置渲染svg到光栅与我的字体。这是我的svg。
目标是实现的模拟
convert.exe -font C:FontsRoadSymbols.ttf C:ua_03.svg C:1.png
但使用CCD_ 3 API。
我试着设置这样的字体:
Magick::Image svgImage("C:\ua_03.svg");
svgImage.magick("png");
svgImage.font("@C:\Fonts\RoadSymbols.ttf");
svgImage.write("C:\1.png");
但我并没有得到要求的结果。
有什么想法吗?
首先使用命令行列出ImageMagick:已知的所有字体
convert.exe -list font
你会看到这样的东西:
Path: /opt/local/etc/ImageMagick/type-ghostscript.xml
Font: AvantGarde-Book
family: AvantGarde
style: Normal
stretch: Normal
weight: 400
glyphs: /opt/local/share/fonts/urw-fonts/a010013l.pfb
Font: AvantGarde-BookOblique
family: AvantGarde
style: Oblique
stretch: Normal
weight: 400
glyphs: /opt/local/share/fonts/urw-fonts/a010033l.pfb
Font: AvantGarde-Demi
family: AvantGarde
style: Normal
stretch: Normal
weight: 600
glyphs: /opt/local/share/fonts/urw-fonts/a010015l.pfb
Font: AvantGarde-DemiOblique
family: AvantGarde
style: Oblique
stretch: Normal
weight: 600
glyphs: /opt/local/share/fonts/urw-fonts/a010035l.pfb
[...]
然后,当要从该列表中选择供ImageMagick阅读的字体时,您可以选择:
(a) 。。。要么使用出现在
Font:
标签后面的字体名称,(b) 。。。或者使用实际字体文件的完整路径(出现在
glyphs:
标签后面。
不要试图在ImageMagick中只使用family:
名称。。。
如果字体名称或路径包含空格,请务必在其周围使用引号
相关文章:
- 防止主数据类型C++的隐式转换
- 模板参数替换失败,并且未完成隐式转换
- 努力将整数转换为链表。不知道我在这里做错了什么
- HEX值到wchar_t字符(UTF-8)的转换
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 将 Qvector<uint8_t> 转换为 QString
- 如何在cuSparse中使用cusparseXcoo2csr从coo转换为csc
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- 在c++中使用nlohmann从类到json的转换
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 将Integer转换为4字节的unsined字符矢量(按大端字节顺序)
- 处理小于cpu数据总线的数据类型.(c++转换为机器代码)
- 如何使用OpenCV将RBG图像转换为HSV,并将H、S和V值保存为C++中的3个独立图像
- 复制列表初始化的隐式转换的等级是多少
- 不存在从"Magick::Color"到"MagickCore::Quantum"的合适转换功能
- 如何在Magick++中编写这些“转换”命令
- 来自Magick++的形态,以匹配命令行转换
- ImageMagick使用我的真字体(Magick++)转换SVG
- 如何将多页Magick++图像转换为QImage
- 如何使用Magick++将YUYV转换为RGB