Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Updating fonts.hbs?

  • #2912
    Avatar photo[anonymous]

    I want to make sure the page only talks to my configured site. It seems my browser is connecting to fonts.gstatic.com on the simple theme. Even with the default OS fonts configured, it seems my browser is told to preconnect to fonts.gstatic.com. Is this a bug?

    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin="">

    This is enabled here, https://github.com/GetPublii/Publii/search?q=gstatic.com&unscoped_q=gstatic.com

    Thanks.

    #2919
    Avatar photoBob

    Yeap, you are right, I will fix it soon.

    #3017
    Avatar photo[anonymous]

    Yes please Bob, please fix this. fonts.gstatic.com is completely blocked in China so we don’t want the site to load slowly, give browser errors, or not to load correctly for Chinese visitors. And speed is the reason we choose Publii’s static html site over WordPress in the first place. Or is it fixed already?

    #3019
    Avatar photo[anonymous]

    In fact for the same above reason, I would humbly suggest that all the free official Publii themes should have self-hosted fonts instead of connecting to Google fonts as both fonts.gstatic.com and fonts.googleapis.com are totally blocked in China, which has 900+ million internet users, a fast-growing English-reading part of their population online probably in millions, and only 10-20% using a VPN for online access.

    #3024
    Avatar photo[anonymous]

    I did some testing with the simple theme and left the fonts at the default of “OS Default Font + OS Default Font”. I setup a new site/page. I blocked *.gstatic.com and tried loading the site. There is zero difference in performance in my test setup. The link tag is only “preconnect”, which is blocked. As the page is not trying to load actual fonts from fonts.gstatic.com, there is no performance impact.

    As expected, the browser tries to open a connection to fonts.gstatic.com just in case fonts are requested. Other than a useless connect in this case, it doesn’t have a performance impact. If gstatic.com is blocked in your environment, the firewall will see the attempt to connect to that domain.

    It appears this isn’t a performance hit, just a spurious connection.

    #3029
    Avatar photoBob

    Thanks for your suggestion but I have no plan to add support for self-hosted fonts.

    #3035
    Avatar photo[anonymous]
    [anonymous] wrote:

    Thanks for your suggestion but I have no plan to add support for self-hosted fonts.

    No plan at all? or not yet?  I’d vote for an option to add self hosted fonts.