Created
February 23, 2020 03:36
-
-
Save Nooshu/bca22676f3491f548c297774c537b865 to your computer and use it in GitHub Desktop.
Simple sample script to test the font load modificaion technique
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test Page: https://keen-northcutt-3190bd.netlify.com/standard-load.html | |
// Paste below into the WPT Inject Script textarea. | |
(function(){ | |
var montserratBold = new FontFace('montserratbold_italic', 'url(fonts/montserrat-bolditalic-webfont.woff2)', { | |
display: 'swap', // test the page using 'swap' | |
weight: '700' | |
}); | |
document.fonts.add(montserratBold); | |
// Wait for the fonts to become ready (optional) | |
document.fonts.ready.then(function() { | |
for (var allowed of document.fonts) console.dir(allowed); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment