Heroku and Google Fonts

前端 未结 6 1752
南笙
南笙 2020-12-31 02:06

Why doesn\'t embedding google fonts work on Heroku?

For example:

\' rel         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 03:08

    The @import generates blocking CSS, which causes a slower page load. Using an extra DNS lookup for your fonts makes this even worse. To improve performance I would swap @import with @font-face and host the fonts locally/on your own web server. You can download the fonts using the Google Fonts download helper.

    IMPORTANT NOTE - Putting your company name in front of something that is released for free to the community is uncool (Google Fonts). Using this to create a 'free service' to track the behaviour of people online is even more uncool. Most people call this stealing (plagiary) and snooping. We tell our kids that this is bad. We (as web developers) should not facilitate this. We should NOT feed Google Fonts to our visitors. Just download these free fonts and serve them from your webserver. They (should) have nothing to do with Google. If you are the owner of any of these fonts, please prevent Google from hosting them. Stop facilitating mass surveillance. Thank you.

提交回复
热议问题