问题标签 [librsvg]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
svg - 将 SVG 转换为 PNG 并保持 CSS 完整性
我目前正在使用 canvg() 和 Canvas2Image 将我的 SVG 复制到画布,然后将画布转换为 PNG。我想保持图像格式而不使用 PDF。
如何保持 CSS 的完整性?图表是使用 NVD3.js 制作的。
svg - Text font issues with rsvg-convert
We were using rsvg-convert for SVG to PDF conversion and it was working like a charm, till we encountered text.
Here's an example-
Command: rsvg-convert -w 842 -f pdf -o testing.pdf testing.svg
Here's the SVG: http://pdf-balancer-693758372.us-east-1.elb.amazonaws.com/development/assets/img/uploads/testing.svg
Here's the PDF: http://pdf-balancer-693758372.us-east-1.elb.amazonaws.com/development/assets/img/uploads/testing.pdf
Problems noticeable in the converted PDF:
Underline is lost
Some text positioning is incorrect (compare the corresponding character in the bold text right below the last character of the non-bold text in both SVG and PDF)
It's is fine in the example in this email but for some fonts, bold markup is lost
.
Help!
macos - 使用 librsvg / rsvg 通过 ImageMagick 转换 SVG 图像
我知道这个问题在这里有几个已回答的版本(例如:ImageMagick convert SVG to PNG not working with RSVG enabled),但实际上我找不到真正解决我的确切问题的方法。我的问题是:我有一个特定的 SVG 文件(我会生成更多),SVG>PNG 转换器进程中的 ImageMagick 不能完美转换。所以我需要将其更改为librsvg,因为确实如此,所以我测试了这两条线,结果不同:
我安装了 HomeBrew。如此处所述:ImageMagick convert SVG to PNG not working with RSVG enabled我使用此代码安装 ImageMagick brew install imagemagick --use-rsvg
。我意识到它没有安装librsvg,所以我需要卸载它并像这样重新安装: brew reinstall imagemagick --with-libsrvg librsvg --use-rsvg
: 这将 imagemagick 和 librsvg 一起安装到我的 mac。但是没有连接它们: convert -list format | grep SVG
结果为:
而这:convert -list delegate | grep svg
结果为:
我安装&卸载&重新安装了几次&方式但没有任何改变,脚本convert test.svg test.png
在没有 librsvg 的情况下运行。我在 /usr/local/Cellar/imagemagick/6.8.9-1/lib/ImageMagick/config-Q16/configure.xml 中添加了带有标签的行,但没有任何进展。我不知道该怎么做以及如何连接 ImageMagick 并强制为convert test.svg test.png
.
谢谢您的帮助。
更多信息:
- ImageMagick 6.6.9-1
- Mac OS X 10.9.4
ubuntu - 使用 RSVG 将 svg 与非本地图像转换
我有一个 SVG 图像,如下所示,我正在尝试将其转换为 PNG:
这在 Ubuntu 10.04 上有效,但现在在 12.04 上无效。原因似乎是 RSVG 现在不会加载任何没有相对路径的图像 URL。
这不是一个选项 - 我的网站生成 SVG(所以我知道它是安全的),但它需要通过 HTTP 加载图像。
图像在 Chrome 中显示良好,但在 Imagemagick、Gimp 或(奇怪的)Inkscape 中显示不佳。
如果有帮助,我将通过 PHP 使用 Imagemagick,但 RSVG 是此处进行 SVG 转换的代表。
除了重新编译librsvg之外,有没有人对如何解决这个问题有任何想法?
我已经尝试过ImageMagick (RSVG) won't import images in SVG的建议,看起来很可疑,就像是这个问题:rsvg doesn't render linked images
我在这里找到了负责的代码:https ://git.gnome.org/browse/librsvg/tree/rsvg-base.c#n2169
我可能是错的,但似乎他们已经禁用了来自其他 URL 的加载,没有任何方法可以在重新编译之前重新启用它?
cairo - Pango 无法使用 librsvg 找到字体
我正在使用 librsvg 将 SVG 文件渲染到 Cairo 上下文。之后,我使用 Pango 在顶部“手动”渲染一些文本。
渲染 SVG 时,我收到 Pango 警告说它无法加载字体:
"couldn't load font "'Calibri' Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output."
之后通过 Pango 进行的手动文本渲染工作得非常好。我尝试了多种不同的字体系列,它们都渲染得很好,没有任何警告。
我什至浏览了 librsvg 源代码以了解它是如何使用 Pango 的,但我看不出与我所做的任何重大差异。
我不知道如何继续调试这个问题,任何关于 Pango 如何在 Windows 下定位字体以及可能影响其查找字体能力的建议都非常感谢。
如果这很重要:
我从这里下载了所有需要的二进制文件:http: //sourceforge.net/projects/ezwinports/files/
delphi - 用 cairo、librsvg 和 delphi 绘制 SVG,改变所有路径的颜色
我正在将矢量图像从 SVG 文件绘制到 TImage。我想在运行时将所有路径的颜色更改为不同的一种颜色,但以下代码仅更改 SVG 的第一条路径的颜色。SVG 中的所有路径都具有相同的颜色(黑色 - #000000)。有人知道,如何改变所有路径的颜色?
android - librsvg - 如何为 android 构建
任何人都有关于如何为 android 构建libsrvg的说明(包括设置应该链接到哪个 c++ 标准库)
提前致谢。
librsvg - Librsvg 分割错误 - 许多图像大约 10MB
我正在尝试渲染分辨率为 4000x4000 的 SVG。我正在使用的命令是:
一个 svg 样本是:
图像大小为 2MB - 24MB。
最后,事情崩溃了,并给了我“分段错误”。
如果我用 1200x1200 的分辨率做同样的事情......
它按预期工作。