« March 2007 | Main | August 2007 »

April 30, 2007

Gran Paradiso Alpha 4 and SVG

Gecko 1.9a4 has been released. Major changes in this release include an update of cairo from version 1.3.12 to 1.4.2 and switching the svg text code from using cairo directly to using mozilla's thebes graphics layer. The former change should give a number of performance benefits, while the latter should give better font selection and proper font substitution for glyphs not in a particular font.

Highlights of SVG bugs fixed since 1.9a3:

Please test your content and file bugs with test cases if you find bugs.

Posted by tor at 5:06 PM | Comments (5)

April 13, 2007

SMIL animation and SVG fonts

Earlier I wrote discussing the fact that SVG fonts and animation are not on our development schedule for Firefox 3. Here are some thoughts about what would be needed to implement these features.

Of the two, SVG fonts is the simpler. There is a patch under review right now in bug 375141 that switches SVG text from using cairo directly via the "toy" API to the same code that handles fonts for the rest of mozilla, which gives us font substitution. The cairo graphics project has been working on a user font API and have it on their roadmap for cairo 1.6. To get started with, I think one might want to concentrate on the case where the SVG font is embedded into the SVG file being rendered (rather than CSS @font-face where SVG fonts could be used in any context). Additionally, it would be easiest to start with the basic form of <glyph> where the glyph is just path data in the "d" attribute. Parsing for path data is already implemented in Mozilla and is reusable via the nsSVGPathDataParserToInternal class. Probably the hardest problem to solve with SVG fonts is making sure that cairo knows about the user fonts only when needed for SVG (painting and various text SVG DOM apis) and not "leak" it into other documents.

SMIL animation is a larger project, but for this you wouldn't be starting from scratch as Brian Birtles undertook this as a school project. His writeup of the project is a bit out of date with the current patch, but provides useful information about the architecture chosen. The most recent version of the patch can be found attached to bug 216462. Brian's thoughts about the next steps needed can be found on comment 13 of that bug. These are mainly concerned with various cleanups of the patch, such as deCOMtamination. After this comes such things as figuring out how to animate properties maintained by the style system (examples: colors, stroke width) and implementing the other SMIL elements (<set>, <animateMotion>, <animateColor>, and <mpath>).

As a final note, if you're interested in working on these features for Firefox 3, the feature freeze deadline is currently scheduled for July 2007. If you have questions or need a few pointers figuring out the Mozilla SVG code, please post to the mozilla.dev.tech.svg newsgroup or see if you can catch us on the irc.mozilla.svg #svg IRC channel.

Posted by tor at 9:58 PM