Closed Bug 711690 Opened 11 years ago Closed 11 years ago

Downloadable fonts shouldn't warn about unsupported formats if supported formats exist


(Core :: Graphics, defect)

Not set





(Reporter: joe, Assigned: jfkthame)



(1 file)

The usual way of making downloadable fonts work in all the major browsers is to have a structure something like:

@font-face {
    font-family: 'TorontoSubwayBold';
    src: url('/toronto_subway_bold-web.eot');
    src: url('/toronto_subway_bold-web.eot?#iefix') format('embedded-opentype'),
         url('/toronto_subway_bold-web.woff') format('woff'),
         url('/toronto_subway_bold-web.ttf') format('truetype'),
         url('/toronto_subway_bold-web.svg#TorontoSubwayBold') format('svg');
    font-weight: normal;
    font-style: normal;

(listing all the different font types).

Unfortunately, this makes Firefox spit out warnings of the form:

Warning: downloadable font: format not supported (font-family: "TorontoSubwayBold" style:normal weight:normal stretch:normal src index:0)
Source File:
Line: 0
Source Code:
@font-face {   font-family: "TorontoSubwayBold";   font-style: normal;   font-weight: normal;   src: url("/toronto_subway_bold-web.eot?#iefix") format("embedded-opentype"), url("/toronto_subway_bold-web.woff") format("woff"), url("/toronto_subway_bold-web.ttf") format("truetype"), url("/toronto_subway_bold-web.svg#TorontoSubwayBold") format("svg"); }

From my point of view, this is unnecessary noise, since there is a format that Firefox supports - woff - specified in the list of sources.

This red herring led me to try to debug problems with my font declarations when what I really needed to debug was my selectors. (So, despite this being a graphics bug, I'm CC-ing Rob Campbell of developer tools fame, because he might have input on this.)
So what you're asking for is no warning right?  If so, that sounds reasonable for the format hint is not one of the ones listed in the CSS3 Fonts spec.  Future formats will generate this until the browser is updated but that doesn't sound so bad.  I agree we should keep error/console noise to a minimum.
I think it's reasonable to warn if there's no compatible format available too; for example, if EOT is the only format used.
This modifies the loading code to only issue the warning if none of the sources loads successfully, and at least one of the sources was skipped because it had an unsupported format hint. (If they all failed to load for other reasons, such as corrupt files or same-origin errors, then separate error messages will have been generated for those attempts.)
Assignee: nobody → jfkthame
Attachment #582817 - Flags: review?(jdaggett)
Comment on attachment 582817 [details] [diff] [review]
patch, don't warn about unsupported font formats if a different source successfully loads

r+ with proper initialization of mUnsupportedFormat.
Attachment #582817 - Flags: review?(jdaggett) → review+
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.