I tried to use google font api by injecting this piece of code into my html code
<link href="https://fonts.googleapis.com/css?family=Playfair+Display|Source+Serif+Pro|Suwannaphum&display=swap" rel="stylesheet">
I found when loading my website the text using the font would "glitch". It would be displayed as small for a brief second then become normal.
After a lot of experimenting I removed &display=swap section from the code and the issue didn't occur anymore and I was able to use the font.
Why does &display=swap cause a glitch? I copied the code directly from google api font website.