76 points · by busymom0 · 5y ago · 41 comments
1. Wait very briefly (100ms) for the font to load, don't render anything yet.
2. If the font hasn't loaded then use a system font and render the page visibly, keep loading the font for another 3 seconds.
3. Substitute the font once it's loaded, or just continue with the system font if it's not.
If the webfont is small enough (~16k on my site, times three for italics and bold, ~50k in total) then this works quite well even on slower 2G connections.
One thing I also do is remove unused codepoints, which can reduce the size quite a bit. In my case, it reduced the size from ~150k to ~50k. I have a little script that just scans all text files in a directory and removes and codepoints that don't exist: https://github.com/arp242/ttftrim
if you consider swapping a font and potentially the layout after the viewer has already started reading the intial load as working quite well, then we definitely have different definitions. the only thing more annoying would be if the layout changed because you threw an ad at me after intial layout
But these days font-display: optional works just about everywhere too.
Also on firefox you can configure the 3 seconds to be something else.
You can also configure this timeouts in your browser (hidden settings, but that's how it is these days) if you really don't like it.
Usually all weights have the equivalent nodes and curves in their bezier paths, so that intermediate weights can be interpolated between masters. The only delta in size you would get is if the joining/flattening of these paths resulted in different nodes in the exported fonts. As different weights typically include the same open type feature code and glyph set, I’m not sure anything else would cause much variation in size.
It's even an option in Firefox. And not something that's hidden in about:config. one of the benefits of Firefox over Chrome.
Only thing that breaks is when developers abuse fonts to display random icons in non-standard ways (other than unicode symbols/emoji/...).
Overriding everything to font-display: optional also forcefully solves the problem but with much less collateral damage.
While you're at it, do you have any tips for disabling all font-weights < 400 and force them to 400? :)
Something like:
min-font-weight: 400 !important;
And I'll be one very happy web user.I'm forced to do it with a userscript currently, which is less than optimal.
In many cases, I just want to read it.
Discussions like this sometimes make me wonder what the value really is. Of course, it is hard to know. For everyone like me, there are others who lose value when presentation is too coarse.
And don't get me wrong. I love well presented material, type, layout all done well. These things do matter. Same with visuals, graphs, animations...
I am not sure damage is the right word.
You're making me wonder if having an option to load pages in "readability mode" by default might be a way to go, going forward. That should work great for the majority of content linked from HN at any rate.
The advantage is that you get one consistent view of the web tailored to your preferences. (putting the user back in control, like in early browsers in the 90s).
And to the author, if I was traveling and on low bandwith networks I'd probably just block all fonts, not sure how effective or what might break but its gotta be better than nothing.
At least in the website I adjusted the fonts of, I set it to use the font locally if you had it, otherwise distributing it selfhosted style so not to send data to another service.
Also Firefox has an option to ignore CSS specified fonts.
I say "should do" because I don't think it comes with fonts. Just CSS and JS files. It should make a real difference on slow connections.
I wish more devs/designers/managers/whatever realized how many people access the internet either on a slow connection or a slow device or both. even in the first world, most areas outside of city limits is spotty 3G territory.
also, nobody gives a fuck about all the fancy bullshit. how many top websites look like something from awwwards?
Here's the discussion from then: https://news.ycombinator.com/item?id=12865998
Web fonts, boy, I don't know - https://news.ycombinator.com/item?id=12865998 - Nov 2016 (323 comments)