Skip to content

Instantly share code, notes, and snippets.

Created February 23, 2020 03:36
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Nooshu/bca22676f3491f548c297774c537b865 to your computer and use it in GitHub Desktop.
Simple sample script to test the font load modificaion technique
// Test Page:
// Paste below into the WPT Inject Script textarea.
var montserratBold = new FontFace('montserratbold_italic', 'url(fonts/montserrat-bolditalic-webfont.woff2)', {
display: 'swap', // test the page using 'swap'
weight: '700'
// 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