Last Comment Bug 711690 - Downloadable fonts shouldn't warn about unsupported formats if supported formats exist
: Downloadable fonts shouldn't warn about unsupported formats if supported form...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: Jonathan Kew (:jfkthame)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-16 21:18 PST by Joe Drew (not getting mail)
Modified: 2012-01-05 06:59 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, don't warn about unsupported font formats if a different source successfully loads (4.13 KB, patch)
2011-12-19 06:58 PST, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Splinter Review

Description Joe Drew (not getting mail) 2011-12-16 21:18:09 PST
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: http://savetransitcity.com/toronto_subway_bold-web.eot?#iefix
Source File: http://savetransitcity.com/wp-content/themes/bueno/custom.css
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.)
Comment 1 John Daggett (:jtd) 2011-12-18 03:34:43 PST
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.
Comment 2 Joe Drew (not getting mail) 2011-12-18 11:28:33 PST
I think it's reasonable to warn if there's no compatible format available too; for example, if EOT is the only format used.
Comment 3 Jonathan Kew (:jfkthame) 2011-12-19 06:58:00 PST
Created attachment 582817 [details] [diff] [review]
patch, don't warn about unsupported font formats if a different source successfully loads

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.)
Comment 4 John Daggett (:jtd) 2012-01-04 18:04:38 PST
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.
Comment 6 :Ms2ger (⌚ UTC+1/+2) 2012-01-05 06:59:18 PST
https://hg.mozilla.org/mozilla-central/rev/2aa777331ed2

Note You need to log in before you can comment on or make changes to this bug.