Last active
November 24, 2022 04:18
-
-
Save flushpot1125/acfd19c7ef4e153df4eccdce1f068b69 to your computer and use it in GitHub Desktop.
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
var createLink = function(fontFamily) { | |
var headID = document.head; | |
var link = document.createElement('link'); | |
link.rel = 'stylesheet'; | |
headID.appendChild(link); | |
link.href = 'https://fonts.googleapis.com/css?family=' + fontFamily; | |
} | |
var loadFonts = function() { | |
jQuery.getScript('https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.0.1/fontfaceobserver.js', function () { | |
var font = new FontFaceObserver("Pacifico"); | |
createLink(font.family); | |
font.load().then(function () { | |
createGUI(font.family); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment