W3C home > Mailing lists > Public > www-font@w3.org > January to March 2010

Conformance criteria for the src descriptor in CSS Module Level 3 - seeking clarification

From: Richard Fink <rfink@readableweb.com>
Date: Sat, 2 Jan 2010 10:28:21 -0500
To: "'John Daggett'" <jdaggett@mozilla.com>, "'Sylvain Galineau'" <sylvaing@microsoft.com>, <robert@ocallahan.org>, 'Håkon Wium Lie' <howcome@opera.com>, <www-font@w3.org>
Message-ID: <000301ca8bc0$385310b0$a8f93210$@com>
John,

 

I’ve been writing some test pages (part of an article on @font-face syntax
I’ve been asked to write) and I’m finding the draft a bit ambiguous
regarding the src descriptor. Specifically, the question is whether multiple
src descriptors within a @font-face declaration would or should validate as
conformant.

 http://www.w3.org/TR/css3-fonts/#the-font-face-rule

It says:

“When a given descriptor occurs multiple times in a given @font-face rule,
only the last specified value is used, all prior values for that descriptor
are ignored.” 

This would suggest that it’s OK to have more than one src descriptor appear
textually, but that all but the final one are ignored.

In other words, this:

@font-face{

font-family: ‘some font’;

src: url(somefont.otf)format(‘opentype’);

src:url(somefont.ttf)format(‘truetype’);

}

Is the functional equivalent of this:

@font-face{

font-family: ‘some font’;

/* src: url(somefont.otf)format(‘opentype’); */

src:url(somefont.ttf)format(‘truetype’);

}

But then, further on, 

http://www.w3.org/TR/css3-fonts/#font-reference-the-src-descriptor

when the src descriptor is discussed specifically, it says:

“This descriptor specifies the resource containing font data. It is
required... It's value is...”

All of which implies a single src descriptor. And, of course, functionally,
Sylvain’s “Highlander Principle” does apply  here - there *is* only the one.
;)

 

So, I suppose my question can be phrased this way: if you were writing a
validator, would more than one src descriptor within a @font-face rule be
flagged as non-conformant? Or what?

 

FYI – in a test of this – where the second src descriptor is crafted to be
unrecognizable by the user agent and the @font-face declaration should
therefore fail and no font resource downloaded or applied - IE, FF, Chrome,
and Safari all pass. Opera fails.

The test declarations being:

                @font-face {

                font-family: 'testfont';

                src: url('dustismo_roman.ttf') format('truetype');

                src: url('dustismo.nnf')format('nofont'); /* constructed to
fail */

                font-weight:normal;

     } 

And for IE:

                @font-face {

                font-family: 'testfont';

                src: url('dustismo_roman.eot');

                src: url('dustismo.nnf')format('nnf');

                font-weight:normal;

     }

All but Opera ignore the declaration and display the fallback font – as they
should IMHO. However, Opera breaks with the pack and takes what it can get
successfully, despite the draft standard, and displays Dustismo Roman.

 

Best regards, and a happy and healthy New Year to all.

rich

 

 

 

 
Received on Saturday, 2 January 2010 15:28:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 11 June 2011 00:14:05 GMT