Live data from Hacker News

Self-host your fonts for better performance

wicki.io

301–310 of 417 posts

Re: Self-host your fonts for better performance

#301
post #260

Earlier quoted context omitted.

I guess this is political-ish now, but yes. I'm a Canuck, and frankly most differences between US political parties is barely tangible. For many parts of the world, with real political differences, the US left and right appear completely identical. Yet sadly, each side seems to see only the differences.

As a fellow Canadian, I think that was more true during the Bush/Gore debates than it has been any time since; becoming less true with time. While the Democrats are somewhere right of our Liberals, and hover somewhere near our Tories, the Republicans are ... Something else entirely. We don't have any party nearly as powerful and obstructive. Try to imagine if the Bloc held control of the Senate, and you may come to u…

Hmm.

My post to which you are replying, directly discusses political differences, stances on specific topics, that sort of thing. Viewed externally, much of the world cannot see a difference here.

Put another way, the differences between US political parties are exceptionally tiny, when measured against the sameness of those parties.

Yet what you're describing instead, is how radicalized / unable to communicate with each other, a party may be. Or those with opposing political viewpoints. Yet I see the same degree of "They're wrong, WRONG!" coming from both main political parties in the US. From people on both sides.

I agree that this is "worse than it was".

Re: Self-host your fonts for better performance

#302

Earlier quoted context omitted.

If they didn’t do this you (or someone with similar attitudes) would be complaining that cross site caching allows fingerprinting and violates privacy (which is almost certainly why they did do this).

Yeah, however, they could make these things configuration rather than imposing a policy on every user: in different contexts different privacy/performance tradeoffs are acceptable

To a first order approximation, nobody actually changes any of these advanced settings. The default is what most people use, and most settings might as well never exist.

Re: Self-host your fonts for better performance

#303

Maybe I'm being naïve, but why don't browsers ship with more popular fonts bundled to avoid problems like these? I have no issue with any of my browsers taking up fractionally more space for an extensive cache of the most popular web fonts when the payoff is better performance on so many sites. Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, bu…

Because web tech (and Google in particular) is a mess of weird politics.

There are some things that are really well executed, and other things where the ball gets dropped completely.

Chrome will come along and do something like hide parts of the url, or allow scroll-jacking, but then say that fonts should probably be a system level implementation.

It would be trivial for the chrome team to establish something like a series of web-safe fonts like Roboto, Inter, Merriweather, etc. Stuff that gets used incredibly often. Even things like licensing aren't really an issue when most of these fonts are under their open license not to mention that Google has the money to be able to license it if they wanted to.

Re: Self-host your fonts for better performance

#304
post #224

Earlier quoted context omitted.

Re: (b): I know there’s a MathJax clone that works around the constant reformatting by precalculating the sizes of the various blocks and putting that into the HTML. So your browser basically makes a big empty placeholder box that the renderer will render into. It’d be neat if something like that were available for web fonts. Each paragraph gets its own “block” that the installed font uses (and contains padding), and…

It's also likely to be implemented as a ton of JS to download, which would either block rendering (see option 1 above), or apply after the content loaded (see option 2). So, a bunch of work to fix something that isn't broken when you turn off webfonts and respect user settings.

With an isomorphic web app, that should be calculated server side.

Re: Self-host your fonts for better performance

#305

Earlier quoted context omitted.

It's actually a really sad primary effect of privacy abuses by large tech companies, let's place the blame where it needs to lie.

In the world without bad actors nobody would need passwords. Should we blame universe, bad actors or just accept that the world is hostile? That said, some decisions should be left to user. I would choose proper caching over theoretical privacy improvement any day.

No, but I don't blame my locksmith for needing locks or 1Password for needing good passwords, I blame the thieves and hackers.

Re: Self-host your fonts for better performance

#306
post #301

Earlier quoted context omitted.

As a fellow Canadian, I think that was more true during the Bush/Gore debates than it has been any time since; becoming less true with time. While the Democrats are somewhere right of our Liberals, and hover somewhere near our Tories, the Republicans are ... Something else entirely. We don't have any party nearly as powerful and obstructive. Try to imagine if the Bloc held control of the Senate, and you may come to u…

Hmm. My post to which you are replying, directly discusses political differences, stances on specific topics, that sort of thing. Viewed externally, much of the world cannot see a difference here. Put another way, the differences between US political parties are exceptionally tiny, when measured against the sameness of those parties. Yet what you're describing instead, is how radicalized / unable to communicate with…

Well that's the rub: Republicans aren't particularly fickle about policy: they have been known to obstruct their own bills in order to undermine the Democrats.

I can't recall when last a Canadian party did such a thing.

Because of that I can't really find much merit in comparing the parties on policy. Public policy doesn't appear to be the primary motivator of the GOP. The Democrats may disagree with the GOP on policy and fight to alter legislation, but the GOP disagrees with allowing the Democrats to shape policy at all.

Re: Self-host your fonts for better performance

#307

Earlier quoted context omitted.

Yeah, however, they could make these things configuration rather than imposing a policy on every user: in different contexts different privacy/performance tradeoffs are acceptable

To a first order approximation, nobody actually changes any of these advanced settings. The default is what most people use, and most settings might as well never exist.

Sure, but the people that do change get these settings are people too, and they’re often the type of people that will be vocal about your product and recommend it to people.

Re: Self-host your fonts for better performance

#308

Earlier quoted context omitted.

From TFA: > Since Chrome v86, released October 2020, cross-site resources like fonts can’t be shared on the same CDN anymore. This is due to the partitioned browser cache

Google could at least globally cache all the fonts when Chrome is installed; a one time download which is then available for use on all sites. If they licensed other browsers to do the same, the number of fonts available to designers would be large without the performance hit.

Good idea, except that the purpose of Google fonts (from Google's perspective) is to provide another means of tracking what sites people are visiting. Maybe a browser extension can do this though.

Re: Self-host your fonts for better performance

#309

Earlier quoted context omitted.

I've always thought the same. I see the same web fonts being used time and time again. It just makes sense for browsers to have an intelligent "permanent cache" - not based on your specific history but a common set of frequently sourced fonts, libraries, etc. This would be especially helpful now that shared caches are going away. One other option is to actually install the font into your OS. Any correctly-coded websi…

> Any correctly-coded website will try a local source first, which should help a lot for poor connections. Then Google Fonts is not correctly coded, as it'll use remote font only. And myriads of websites reusing Google Fonts snippets. To try local source first, you have to explicitly ask for it in @font-face/src which Google Fonts does not do. So installing font into your OS won't help you with any website using Goog…

From the google fonts FAQ it says they will use the locally installed font if possible

https://developers.google.com/fonts/faq#can_i_download_the_f...

> Note that when browsers render websites that use the Google Fonts API, they will check if a font is installed locally on your computer, and prefer to use the local version over web fonts.

Re: Self-host your fonts for better performance

#310
post #194

Earlier quoted context omitted.

I HATED sites that used custom fonts when I lived in the country. There are only two ways loading such a site goes: a) you get to stare at a blank page for a couple minutes while the font downloads, if it downloads at all. (this seemed to be google's favorite way to screw over people with bad connections; acknowledgment that it's going to suck and doing it anyway) b) you get two minutes into reading the page only for…

Re: (b): I know there’s a MathJax clone that works around the constant reformatting by precalculating the sizes of the various blocks and putting that into the HTML. So your browser basically makes a big empty placeholder box that the renderer will render into. It’d be neat if something like that were available for web fonts. Each paragraph gets its own “block” that the installed font uses (and contains padding), and…

You'd just have to send the font metrics first or extract them early from a partially downloaded font. Then render with temporary glyphs.
Post reply on HN