Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test 'font-display: swap' on your local machine?

To overcome invisible text, PageSpeed Insights suggested using the fallback font for the whole application using font-display: swap in the @font-face declaration. I have added the property to each of the @font-face of my web application, but am unable to test it as the changes are still on my local machine.

So, now how do I test font-display: swap on my local machine and make sure it works and probably capture some screenshot or have a document supporting it?

like image 743
Vibhor Dube Avatar asked Dec 07 '25 07:12

Vibhor Dube


1 Answers

I've used Lighthouse which is built-in to achieve this. This is the best you can do to test the same on local as far as I know. Check the screenshots below-

  • Before adding font-display: swap to the @font-face-enter image
description here

  • After adding font-display: swap to the @font-face- enter image
description here

Reference: Can I use pagespeed insights for my local host website or offline?

like image 111
Vibhor Dube Avatar answered Dec 08 '25 22:12

Vibhor Dube



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!