Answer the question
In order to leave comments, you need to log in
How to know if font loaded from font-face?
Interested in the question, is there any method to find out if the custom font was loaded from font-face?
I need this in order to set separate css rules for the alternative font.
Answer the question
In order to leave comments, you need to log in
document.fonts.ready.then(function() {
//Пишите условие, которое должно выполниться, после загрузки шрифтов...
//Например текст opacity: 1 (предварительно указав в стилях opacity: 0)
//Это предотвратит "скакание" шрифта при загрузке страницы.
});
Using jQuery, you can find out the current properties of an object:
a = $(".someClass").css("font-family");
Result: "Arial, Helvetica, sans-serif"
isn't it
document.defaultView.getComputedStyle($('.answer')[0], null).fontFamily
FF has an extension Font Finder and it can show how the font is rendered.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question