-
Notifications
You must be signed in to change notification settings - Fork 37
Doesn't check loading of several fonts with same name but different font-weights #13
Comments
… font weight has been loaded. Also, be warned that faux-bolding will make the script think a bold weight has loaded when it has not.
Hm, I spent quite a bit of time trying to pass the loaded font-weight in as an argument to the success callback, but I don’t think that’s going to work. It’s trivial to do with the CSS Font Loading API but not with the fallback behavior. I’m open to ideas! Consider the scenarios:
So, in the Of note, this does not work around faux bolding. I think this is OK-ish. Open to suggestions, of course. I haven’t decided yet if this is worth merging into master (it’s about a 20% growth in GZIP file size), but it’s available for use in that branch. |
|
Hm, I tested out fontfaceobserver https://github.com/bramstein/fontfaceobserver to see if he had a better approach for this and it would seem to also trigger callbacks for the faux versions. cc-ing @bramstein just so he’s aware. |
Yea, this is a known problem. The Web Font Loader has the same issue. I think the only work-around is |
The
demo head
demo loads two fonts with the same name but different font-weights.http://fonts.googleapis.com/css?family=Raleway:600,400
gives this:The script doesn't check if both are loaded, confirmed by @zachleat in this tweet.
The text was updated successfully, but these errors were encountered: