Fonts management in 2.8

Hi, I just updated to 2.8 and as soon as I tried to re-open my project I got asked about the fonts I used… I didn’t find any major change about fonts management in the notes, but it looks like I can’t use Google web fonts anymore (at least not the easy way). Anyone else had this problem?

Hi Nicolas, we don’t use Google fonts since Sparkle 2.6, though it’s the same collection of fonts (for the most part), this was because of GDPR and Google’s lack of clarify on what they do with the IP addresses collected via font delivery on fonts.google.com.

In 2.8 we had to remove the use of a bunch of system fonts, because earlier this year Safari started ignoring system fonts except for a handful (Helvetica, Times, the usual). This is due to system fonts being used as a way to track users online.

3 Likes

@duncan, Wow I didn’t know that! I thought we were still using the Google fonts, but I do get what you are saying about the GDPR issue. So Duncan how does the fonts work now in Sparkle? I’m just guessing at this but everytime I create a project would a folder of fonts be part of what Sparkle generates as per project?

Yes any web font is delivered along with the exported/published website.

There are a couple additional implications. One is that if you used a very popular google fonts webfont, your browser might already have it cached, making loading quicker. This is not going to happen with a Sparkle website: the very first time a visitor comes to your site they’ll not find the font cached and will download it. Let’s say this is a sacrifice in the name of privacy.

But there’s also a positive aspect. In the http/1.1 era of the web, browsers limited how many concurrent connections they would have from each domain, generally some small number like 4. So if you had dozens of images, js, css files, they would all be waiting on an available connection to be downloaded. This led optimizations like “domain sharding”, i.e. having one or more subdomains for images, each opening to 4 connections. Webfonts loaded from fonts.google.com would also have their own independent/parallel 4 connections.

With http/2.0, domain sharding is an anti-pattern. The problem with separate connections to the server is the connections themselves (called sockets) use a “slow start” strategy of congestion control:

to avoid sending more data than the network is capable of forwarding

So multiple connections will all start slowly. http/2.0 addresses this by using a single connection to the server, and interleaving all the requests on the same connection, reducing the number of slow starts to one per domain. Thus it’s bad to have multiple domains, the very best is to only ever connect to a single domain.

That’s what Sparkle sites do, including with fonts. The vast majority of web servers support http2 (though many are not configured for it), and all modern browsers do as well.

In light of this, the advice many site performance tools say about “having too many css/js files” is bogus in the context of http2, because the separate files will still be transferred on the single connection.

1 Like

@duncan, A big thank you for that thorough explanation… appreciated! :slight_smile:

Well notifications made me realize I never thanked you for your answer, so late thanks Duncan!

1 Like