On mythbusting and the web... and why SVG Fonts are sometimes useful
Tuesday, January 25, 2011 8:41:08 PM
This is a response to "Mythbusting: Why Firefox 4 won’t score 100 on Acid3".
To get the facts straight, let's start with some history.
Acid3 is a test released in 2008 that tests EcmaScript and a number of different W3C Recommendations. The test as a whole is heavily focused on DOM functionality, and gives the tested browser a score from 0 to 100 based on how many subtests were passed. Having 100/100 is not enough by itself to pass the test; the rendering must also look exactly like the reference page.
Ian Hickson compiled the first 84 tests, and announced a competition to fill the 16 remaining subtest slots, open to anyone that had a test that fulfilled the conditions (quoted with emphasis added in red below):
- The test must consist of the body of a JavaScript function which returns 5 when the test passes, and which throws an exception otherwise. It doesn't matter what kind of exception.
- The test must compile with no syntax errors in Firefox 2, IE 7, Opera 9.25, and Safari 3. (You can use
eval()to test things that are related to syntax errors, though.)- The test must not crash any of Firefox 2, IE 7, Opera 9.25, and Safari 3.
- The test must fail (throw an exception) in either a Firefox trunk build from January 2008 or a Webkit trunk build from January 2008 (or, ideally, both). (Opera and IE are failing plenty of tests already, I don't want to add more tests that only fail in one of those. Of course if you find something that fails in Firefox or Webkit and Opera or IE, so much the better.)
- The behaviour expected by the test must be justifiable using only standards that were in the Candidate Recommendation stage or better in 2004. This includes JavaScript (ECMAScript 3), many W3C specs, RFCs, etc.
- You must be willing to put your test into the public domain. (I don't want us to end up with any copyright problems later!)
Several people of various affiliation (myself included) contributed tests during the week the competition was open.
Now, every once in a while (usually around major version release time), various companies and individuals complain about having to fix bugs and/or implement web standards to pass the test.
- Boris ZbarskyOpera and Webkit implemented (very brokenly, in at least Opera’s case) a small subset of SVG 1.1 Fonts; basically just enough to pass Acid3.
Opera 8 was the first version of Opera that shipped with native SVG support back in 2005. A full version history is also online these days thanks to Frank M. Palinkas. Opera 8 had support for much the same subset of SVG Fonts we support in Opera 11 today. True, we did have to revisit the fonts code several times after Opera 8, to fix it to properly deal with unicode surrogate pairs for example and a slew of other bugs unrelated to Acid3 (remember, this was before Opera even passed Acid2). Granted, we did add support for the SVG <altGlyph> element because that was a required part of subtest 79 (created by Cameron McCormack) in Acid3. That was something that we simply hadn't prioritized, much like many of the other (uncontroversial) things tested by Acid3. As far as the "very brokenly implemented" remark goes, feel free to submit bugs to the Opera bugtracker.
- Boris ZbarskyAt this point, the SVG working group has decided that SVG Fonts will no longer be a core part of SVG but will be a separate specification, and that it might need some serious work if anyone is ever to implement it in full.
It's correct that the SVG WG has been asked to split out the SVG Fonts chapter to a separate specification. This is most likely going to happen as part of the work on SVG 2.0 (or SVG.next, call it what you will). An interesting tidbit is that SVG Tiny 1.2 requires support for the same subset of SVG Fonts that has been implemented independently by several vendors to date. It's a fully backwards-compatible subset, a SVG Tiny 1.2 font is compatible with SVG 1.1 user agents - provided of course that they support at least the same subset of SVG 1.1 Fonts.
- Alexander LimiIn other words, the WOFF font standard is more appropriate, works in more browsers, and is a better way to handle custom font support in browsers.
There are also the TrueType (TTF) and OpenType (OTF) formats, which are equally appropriate, at least if transferred with gzip content-encoding. In fact, downloadable truetype fonts is a part of Acid3 (see the top right corner of the test). WOFF can be used for some things, and it's not a bad format, but it doesn't have the same feature-set that SVG Tiny 1.2 fonts has, and saying they can always replace each other is simply not true. More about that below.
Myth #1: You need to implement the whole SVG 1.1 Fonts chapter to pass Acid3
To be really clear: the entire feature-set of SVG Fonts, where each glyph can have e.g many different fills and strokes, raster images, animation, and be arbitrarily complex, as specified in SVG 1.1, has not been implemented in a single SVG user agent to the very best of my knowledge. Nor is it a required part for passing the Acid3 test.
Myth #2: SVG Fonts and foreignObject support are both required to pass Acid3
- Boris ZbarskyOnce you put an <iframe> in a glyph, all sorts of issues arise — both in terms of the spec being underdefined and in
terms of the behavior being very difficult to implement, no matter what the spec said.
The spec is really quite clear:
It is not required that the SVG user agent supports the ability to invoke other arbitrary user agents to
handle embedded foreign object types
So in fact it's not underdefined, it's explicitly not defined.
But what are SVG Fonts good for?
Here are a couple of examples:
- Provides simple and manipulable graphics that can help in preserving text as text while maintaining the same visual appearance
- Crossplatform, crossbrowser, with exact metrics and rendering specified by the SVG specification - e.g very useful for designing tests, or for platforms where you can't install fonts as a user
- Easy DOM access to glyph outlines (path data)
- SVG Fonts are fully editable in a text editor
- The path data syntax is more expressive than what e.g WOFF/OTF/TTF fonts allow
- Can be "misused" to do specialized stroking (e.g chain fonts, roads or railroad tracks) - granted, this is also true for other kinds of fonts.








Unregistered user # Tuesday, January 25, 2011 11:12:44 PM
Unregistered user # Wednesday, January 26, 2011 9:17:49 AM
Unregistered user # Wednesday, January 26, 2011 9:20:44 AM
Erik DahlströmMacDev_ed # Wednesday, January 26, 2011 10:31:14 AM
The Abbra SVG engine probably has the most advanced implementation of SVG Fonts, that's true. Still I haven't seen evidence to indicate that it implements the entire feature-set of SVG 1.1 Fonts. Video isn't part of SVG Tiny 1.2 fonts, nor is it part of SVG 1.1 fonts (except if you nest it inside foreignObject, and like already stated then the behavior isn't defined), but it's a fun demo for sure
About Batik, do you have any examples to share?
Unregistered user # Wednesday, January 26, 2011 11:10:49 AM
FransFrenzie # Wednesday, January 26, 2011 12:43:30 PM
Originally posted by anonymous:
Pretty much the article as a whole I'd say, but particularly the last part ("But what are SVG Fonts good for?") and that SVG Tiny 1.2 requires it. Depending on your perspective you could say that merely adds some more brownie points, but my perspective is that I can play around with SVG Fonts without learning any new tools or technologies. If I were to create a TTF/WOFF/whatever kind of font, most likely I'd import glyphs from SVG as a starting point.
Dustin WilsonKhadgar # Wednesday, January 26, 2011 4:17:45 PM
A while back I created an SVG font version of my logo for testing purposes and to perhaps use on my weblog whenever I got around to redesigning it. My logo only uses integers for point coordinates because it was glyphs from a font to begin with, but that doesn't mean that I could do this in TrueType, OpenType, or WOFF. I'd have to deal with hinting and subpixel rendering adjustments to my logo which would change its appearance drastically based upon what operating system was being used by the user.
It's absolutely amazing how ignorant and close minded these people can be. Glad none of them are developing the browser I use.
Michael Johnsonpitredbeard # Wednesday, January 26, 2011 4:59:30 PM
While that may not be generally useful, I can see an illuminated font being used for the initial letter of a paragraph (or section, or whatever). That's not possible in any other common font technology, AFAIK.
Cutting Spoonhellspork # Wednesday, January 26, 2011 7:40:57 PM
Unregistered user # Wednesday, January 26, 2011 7:47:15 PM
thobi # Wednesday, January 26, 2011 8:11:51 PM
Originally posted by anonymous:
i'd say you are right - and wrong
Originally posted by Boris Zbarsky:
sounds to me like they don't want to implement a bit of it to get the points, right. but they neither want to do it right because they think it's not useful, worth the work or whatever.
anyway, i'm not a pro. i don't know who if the opera way or the mozilla way is the better one. but opera went for a svg-support a long time ago and mozilla just came up with the idea of skipping the last 3 points?!
Unregistered user # Wednesday, January 26, 2011 8:45:46 PM
Unregistered user # Wednesday, January 26, 2011 10:13:18 PM
FransFrenzie # Thursday, January 27, 2011 10:20:26 AM
Originally posted by anonymous:
I just explained how it has significant benefits to me, and so did Dustin Wilson. And that was in addition to the benefits listed in the OP. You may dismiss these benefits as inconsequential, but it is a niche that's left wide open by TTF/OTF/WOFF. One could make the argument that SVG fonts are better suited for text-containing logos and headings whereas WOFF is better for replacing Verdana by something with a little more character.
The best argument I've read against SVG Fonts is that it's not very well suited for scripts like Arabic, but I don't know enough of the subject matter to know whether it's really that big an issue. At any rate that's still kind of a Catch 22 argument.
Originally posted by anonymous:
I think SVG Fonts, even "just" the subset from SVG Tiny 1.2, are useful. The fact that it's tested in Acid3 to some extent is almost entirely coincidental to me (except I imagine the creators of Acid3 agree or they wouldn't have included it
To add another point, I'd like to emphasize that SVG can be an alternative to PDF. As Lars Sonchocky-Helldorf wrote, "your reluctance towards SVG-fonts could tip the scales whether SVG as a file format gets some relevance or degenerates into insignificance."
Unregistered user # Thursday, January 27, 2011 10:37:37 AM
Unregistered user # Thursday, January 27, 2011 11:25:53 AM
Chirpie # Thursday, January 27, 2011 11:27:19 AM
Originally posted by anonymous:
I wouldn't say so. Rather, it corrects the FUD Mozilla was spreading about Opera.Originally posted by anonymous:
You are ignoring the context. The two myths were mentioned because of Mozilla's FUD statements against other browsers. Mozilla implied that Opera only supported SVG Fonts to pass Acid3, when it had in fact supported it since before Acid3 was made. So the context here is the background for the actual facts.Do you work for Mozilla? They seem to have this thing for misrepresenting people and spreading FUD about competitors.
Chirpie # Thursday, January 27, 2011 11:36:49 AM
So to Mozilla -- fewer excuses, more action, OK?
Unregistered user # Thursday, January 27, 2011 6:55:32 PM
Cutting Spoonhellspork # Friday, January 28, 2011 2:11:03 AM
Charles SchlossChas4 # Friday, January 28, 2011 4:12:06 AM
ChrisSlamdex # Friday, January 28, 2011 5:53:09 AM
Originally posted by anonymous:
You can't base your claims about compliance on those tests. They don't even test the whole thing. But why are you talking about CSS in a post about SVG?Unregistered user # Friday, January 28, 2011 3:35:53 PM
Chirpie # Monday, January 31, 2011 10:28:54 AM
Originally posted by anonymous:
Yeah, it's a clever PR move by Microsoft. Makes it look like IE is ahead when it isn't.The real thing is ignored? I'm not sure if you realize this, but html5 was started by a group of browser vendors, and created to be compatible with the current web while also expanding capabilities. So html5 is definitely the real thing, and not being ignored. On the contrary.
I don't know what you think browser vendors are ignoring, but I think you must be misunderstanding something.
Unregistered user # Saturday, February 5, 2011 6:50:47 PM
Cutting Spoonhellspork # Sunday, February 6, 2011 4:32:32 AM
FransFrenzie # Sunday, February 6, 2011 11:35:53 AM
Cutting Spoonhellspork # Monday, February 7, 2011 2:03:02 AM
Unregistered user # Wednesday, February 23, 2011 3:16:39 AM
Cutting Spoonhellspork # Wednesday, February 23, 2011 7:10:39 AM
Unregistered user # Wednesday, March 16, 2011 10:40:14 AM
Cutting Spoonhellspork # Wednesday, March 16, 2011 7:09:16 PM
FransFrenzie # Monday, July 4, 2011 11:25:25 AM
http://jeremie.patonnier.net/post/2011/02/07/Why-are-SVG-Fonts-so-different