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

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 UTC