--- title: Mozilla的SVG项目 slug: Mozilla_SVG_Project tags: - SVG - 矢量图 translation_of: Mozilla/Mozilla_SVG_Project ---
如果你已经了解了一些基础知识,你可能知道SVG代表Scalable Vector Graphics(可缩放的矢量图形),是用XML语言表示二维图像的一种格式。与之相关的SVG面向图形、XHTML面向文本、MathML面向数学方程式、CML面向化学分子式。
SVG与Adobe拥有专利的Flash技术有相似的范围:除此之外它还提供反锯齿的渲染、图案和渐变填充、复杂的滤镜效果、剪切到任意路径、文本和动画。如何区分SVG和Flash呢?SVG是W3C推荐标准(亦即,它是一个用于所有目的的标准),而且它是基于XML的语言,与封闭的二进制格式截然相反。它明确设计用来与别的W3C标准比如说CSS、DOM和SMIL一起作用。
Firefox自从Firefox 1.5版本以来,原生支持SVG文件。
此时你好奇SVG看起来是如何,这里有一个示例:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <g fill-opacity="0.7" stroke="black" stroke-width="0.1cm"> <circle cx="6cm" cy="2cm" r="100" fill="red" transform="translate(0,50)" /> <circle cx="6cm" cy="2cm" r="100" fill="blue" transform="translate(70,150)" /> <circle cx="6cm" cy="2cm" r="100" fill="green" transform="translate(-70,150)" /> </g> </svg>
这个示例应该看起来如下所示(这是在Mozilla Forefox 1.5中呈现的):
Mozilla SVG编译器是一个原生的SVG编译器。它与插件SVG浏览器比如说Adobe viewer截然相反。
这两者有这些影响:
Gecko 1.8 添加了SVG支持,从此它包含在Mozilla Firefox V1.5以及后的版本中。
The goal we're working towards with Mozilla's SVG implementation is SVG 1.1 Full. What exists now in the tree should be treated as a technology preview. As we implement more of the specification, content written against Mozilla's SVG implementation might break if it unintentionally relies on bugs that are fixed. We realize this is not ideal, but ask you be patient as we continue implementing an extremely large specification that lacks a comprehensive test suite.
Our goal is specification conformance. Where the specification and other implementations of SVG differ, we will conform to the specification. Where the specification is ambiguous, we will make an informed decision, consulting the SVG working group and other experts as appropriate.
While we are still a long way away from full SVG support, the subset currently implemented is already pretty usable. We have support for all basic shapes including beziers, stroking and filling with opacity, gradients, scripting, events, and much of the DOM.
Big areas of the SVG specification where we're still lacking include filters, svg defined fonts, and declarative animations. A page listing the current implementation status of svg elements and the rendering backends can be found at Mozilla SVG Status.
SVG 1.1 is a big specification and we still have a lot of work to do to fully implement it. If you think you can help us by e.g. tracking down bugs, writing some test-cases or implementing some outstanding features, please get in touch.
We have an IRC chat channel, #svg, on irc.mozilla.org.
There is also newsgroup/mailing list dedicated to SVG in Mozilla. It's called mozilla.dev.tech.svg.
If reporting bugs, the best place for them is in bugzilla so that we can track them and you can monitor the progress. File them in the "Core" product with the "SVG" component. If you have a testcase (which we love to have), please use the attachment feature of bugzilla to include it rather than pasting it in the bug.
Before asking us questions directly, please take a look at the Frequently Asked Questions page to see if your question has already been answered. If your question hasn't been answered there, try asking in our newsgroup or IRC channel.
{{ languages( { "ja": "ja/Mozilla_SVG_Project" } ) }}