Skip to content

Instantly share code, notes, and snippets.

@gaurangrshah
Created May 15, 2021 18:35
Show Gist options
  • Save gaurangrshah/4d236adb939425ed22d86cde782bd5af to your computer and use it in GitHub Desktop.
Save gaurangrshah/4d236adb939425ed22d86cde782bd5af to your computer and use it in GitHub Desktop.
function checkFonts() {
document.fonts.onloadingdone = function (fontFaceSetEvent) {
console.log(
"🚀 ~ file: default.js ~ line 27 ~ checkFonts ~ fontFaceSetEvent",
fontFaceSetEvent
);
alert(
"onloadingdone we have " +
fontFaceSetEvent.fontfaces.length +
" font faces loaded"
);
};
}
/*
* USAGE:
useEffect(() => {
console.log(checkFonts());
}, []);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment