typekit / webfontloader

Web Font Loader gives you added control when using linked fonts via @font-face.
Apache License 2.0
9.23k stars 650 forks source link

With switch to `NativeFontWatchRunner`, not all events are fired for all `load` calls #410

Open jtsternberg opened 5 years ago

jtsternberg commented 5 years ago

With version ≤ 1.6.7, all callbacks would be fired for each WebFont.load() request. E.g. two alerts would happen in this scenario:

WebFont.load({
    active : function() {
        alert('WebFont.load active 1', arguments);
    },
    inactive : function() {
        alert('WebFont.load inactive 1', arguments);
    },
    custom: {
        families : [ 'Font Awesome:400' ],
        urls     : [ 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css' ]
    }
})
WebFont.load({
    active : function() {
        alert('WebFont.load active 2', arguments);
    },
    inactive : function() {
        alert('WebFont.load inactive 2', arguments);
    },
    custom: {
        families : [ 'Font Awesome:400' ],
        urls     : [ 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css' ]
    }
})

But with ≥ 1.6.8, the callbacks for only one of the load() calls are fired, so only one alert in the above scenario.

See for yourself:

jtsternberg commented 5 years ago

Feels like maybe #152 is related.