TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Resvg- a fast, small, portable SVG rendering library in rust

42 点作者 CyMonk将近 3 年前

2 条评论

vlmutolo将近 3 年前
This library&#x27;s focus on correctness is what made me realize how absurdly complex SVG rendering is.<p>They focus only on static SVG, and only on SVG 1 (though apparently they&#x27;re working on SVG 2 support) and they still only manage to pass something like 90% of the tests.<p>Which is more than any of the popular browsers or SVG rendering libraries. I wouldn&#x27;t be surprised if resvg were the most compliant SVG renderer in existence.<p>And that doesn&#x27;t even take into account the <i>actually</i> complicated parts of SVG, like requiring an entire JavaScript interpreter for the &lt;script&gt; tags, which resvg rightfully excluded from its scope.<p>These decisions made sense for the web, I guess, where all of the pieces were already there. The browsers already had to handle native text rendering, JavaScript, etc. It seems like SVG became something like a common interface to the drawing primitives browsers had anyway. Plus JavaScript.<p>I&#x27;d like to see a much smaller, embeddable vector graphics format that doesn&#x27;t require a whole browser to implement it.
评论 #31714799 未加载
评论 #31716633 未加载
hirenj将近 3 年前
I make use of a library in R to render SVG that uses Cairo to render to an intermediate (simplified) format, which looks a lot like what Resvg is doing with usvg. The advantage here seems to be that this is a much more compact library (fewer dependencies maybe?)<p>Does anyone know if rust plays well acting as the backend for R libraries?<p>How does this rendering&#x2F;simplification compare with Cairo? I’m wondering if this is a fun summer project for some student!