6 ms·
More than you ever wanted to know about font loading on the web (2021)
- PaulHoule 4y agoI've wondered if Cumulative Layout Shift is more of a feature than a bug. All the time I try to click on something, the layout shifts, and I wind up clicking on an ad. Maybe that's how Google can get $50B a year in ad revenue but you can't find anybody who admits they've clicked on an ad.
- egberts1 4y agoYes. This is a problem when trying to speed clicking NEXT button, it shifted and it’s “AD TIME!” I am looking at you, Taboola.
- lowercased 4y agoagreed, but i've found it easier/safer to just back out of sites when I see taboola stuff on them in the first place. it seems to be an indicator of the (non)quality of many sites.
- jfk13 4y agoIn my experience, if you're reading something that involves constantly clicking a NEXT button, you're generally reading garbage anyhow.
- nonameiguess 4y agoFat-fingering links on a touchscreen that you have to touch to scroll is likely at least as big a factor, but I would hope the ad network is able to measure whether a person actually stays on the page versus immediately hits the back button and not pay for the immediate back buttons.
- johnwalkr 4y agoI didn’t know this term so thank you! Another one I noticed on my work iPhone is when your phone can’t handle scrolling some bloated site, and scrolling is registered as a click on an ad.
- celestialcheese 4y agoI'm in the industry and this is more true than anyone wants to admit. Googles entire business model depends on building enough "Cool Shit", and hiring the "Best and Brightest" to reputation wash the fact that most of their GDN / AdX / GAM revenue is click-tricking navigation/actions and misclicks.
- kuharich 4y agoPast comments: https://news.ycombinator.com/item?id=25976844 https://news.ycombinator.com/item?id=25976844
- lelandfe 4y agoAnd today's discussion, where this came from: https://news.ycombinator.com/item?id=31680414 https://news.ycombinator.com/item?id=31680414
- dingleberry420 4y agoAlternatively, just stop messing with the font. It's not necessary, annoys users and takes a lot of work to get right.
- lelandfe 4y agoI know HN can be pretty utilitarian at times, but custom fonts are nice. The New Yorker simply would not be The New Yorker without their font stack. It's not that hard to get right (seriously, it should take maybe an hour?) and won't need to be touched ever again once you have it in good shape :)
- azemetre 4y agoIf you don't use custom fonts and strictly system fonts, you get a lot of performance benefits; which may seem minor, but multiple this by tens of millions of people and you're talking about a real world climate impact here. If the choice is between style vs performance, we should always default toward performance. Besides many OS's have added more system fonts throughout the last two decades. If anything we need to encourage OS's to have more interfont operability (if that's a word), I don't know the legal ramifications (there's gotta be one) but there's no reason why the most popular google fonts couldn't be included in various OS's. Obviously I'm not an OS dev, so I'm curious if the limitations are purely legal or implementation.
- lelandfe 4y agoBrowsers are actually going the opposite way now, and are locking down access to system fonts beyond a standardized list: https://wicg.github.io/local-font-access/ https://wicg.github.io/local-font-access/ This is to prevent fingerprinting of users (adding new browser-accessible fonts would sadly mean more accurate fingerprinting)
- azemetre 4y agoWow, I had no idea. Thanks for the info but this is beyond disappointing.
- missblit 4y ago> browsers no longer cache resources across top level sites. Wait is this true? Definitely warrants some kind of citation. If no one's heard one way or another I might test it later because I'm pretty skeptical of this claim. Edit: mind blown
- kube-system 4y agohttps://developer.chrome.com/blog/http-cache-partitioning/ https://developer.chrome.com/blog/http-cache-partitioning/
- beejiu 4y agoYes, it seems like it is now true. https://developer.chrome.com/blog/http-cache-partitioning/ https://developer.chrome.com/blog/http-cache-partitioning/
- zinekeller 4y agoYes, all modern browsers divide their cache per-site. Some large advertising companies like Taboola have abused caches to store unique identifiers. I won't be shocked if Google and Facebook have also used this, so Safari (from 2013, https://bugs.webkit.org/show_bug.cgi?id=110269 https://bugs.webkit.org/show_bug.cgi?id=110269), Firefox (depending on settings from 2018 and widely deployed in 2020, https://developer.mozilla.org/en-US/docs/Web/Privacy/State_Partitioning https://developer.mozilla.org/en-US/docs/Web/Privacy/State_P...) and Chrome (from 2020, https://developer.chrome.com/blog/http-cache-partitioning/ https://developer.chrome.com/blog/http-cache-partitioning/) now separate caches.
- bombcar 4y agoIt's true and kind of asinine in my opinion, and actually makes setting up a Squid cache worthwhile again, potentially.
- usr1106 4y agoWasn't it so that squid does not support https? If yes, there shouldn't be much to cache today.
- 4y ago
- everdrive 4y agoI wonder if there is some way to always block remote fonts? Seems like a real bandwidth saver.
- ormax3 4y agouBlock Origin can: https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-remote-fonts https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-...
- forgotmypw17 4y agoIt can be done in Firefox, it is just one setting in about:config. gfx.downloadable_fonts.enabled Some sites rely on icon fonts for buttons, and they appear as Unicode placeholders instead. I don't mind, and consider it a time-saving benefit which reduces my effort spent on low-quality websites.
- sogen 4y agoIn Chrome, uBlock origin can block webfonts.
- chrismorgan 4y agoBe sure to block JavaScript as well. Makes the web a lot faster, and very often better too, with only the occasional site (though considerably more of certain types of sites) breaking. What I settled on a couple of years back was to disable JavaScript with uMatrix, but have that extension disabled in Private Browsing mode, so I can just open a Private Browsing window if I want to run something with JS. In Firefox, you also just have the “Allow pages to choose their own fonts, instead of your selections above” checkbox in Settings → Fonts → Advanced that you can untick, which will stop most web fonts from loading, though Private Use Area code points (used in icon fonts) will still work from web fonts (so that Google’s Material Icons with its stupid ligation technique is just about the only thing that will be mangled).
- mmmpop 4y ago> only the occasional site (though considerably more of certain types of sites) breaking. That is not at all my experience while browsing without JS enabled.
- chrismorgan 4y agoThere are various other CSS properties that are linked to the font so that the result is bad if another font gets used. letter-spacing: this has been giving me grief recently. It’s mostly a tool for people second-guessing the font designer because they chose a font that they liked but didn’t actually like because it was too wide, and now they’re tightening the letter-spacing, but poor people like me who have told their browser not to let pages override their font choices¹, or those for whom the web font just fails to load for whatever reason, now have to suffer for it, surprisingly often to the point where letters collide (not often in the scheme of things, but surprisingly often to me). My opinion is that you should absolutely never adjust letter-spacing at body text sizes, with the sole exception of all-caps text where it is generally desirable to add up to about 0.05em. If you feel the need to set letter-spacing on body text in any other situation, you’re using the wrong font. font-feature-settings: some OpenType features are generic, like tnum for tabular numbers, but others like stylistic sets are explicitly linked to a particular font, so that if you set this globally in this way, you might actually trigger something in another font that ruins things. For example, my monospace is Triplicate, and ss01 makes it not monospaced (called the Poly variant), so if you activate ss01 and were doing box drawing or similar, it just got ruined. Or if you’re using a version of panr’s Terminal theme² for Hugo from more than a few months ago (when it got fixed for the wrong reasons, but it got fixed), it has the case feature set improperly, which is supposed to just adjust vertical positioning of some punctuation to fit all-caps text, but in practice a number of font foundries (including at least one of the biggest) have decided to work around inferior desktop publishing software (leastways, that’s why Matthew Butterick decided to do it) by making that feature also substitute uppercase glyphs—so now the entire page is all caps. The particularly galling part to me is that there actually is a defined way of doing this properly for font-feature-settings, scoping by font, but Firefox implemented it in 2014 and no one else has touched it. Sigh. /* The current and inferior way: */ code { font-family: triplicate, monospace; font-feature-settings: "ss01"; } /* The new and improved way that Google and Apple haven’t implemented: */ @font-feature-values triplicate { @styleset { poly: 1; } } code { font-face: triplicate, monospace; font-variant-alternates: styleset(poly); } I’d really like something better for letter-spacing, too. Maybe a letter-spacing-adjust @font-face property or something. I dunno. —⁂— ¹ I started doing this a few months back in Firefox as an experiment, and I’ve never gone back—it significantly improves the web, with Google’s Material Icons web font with its stupid ligation technique being practically the only meaningful casualty. ² Which I hate, by the way—monospaced fonts are generally quite bad for long-form reading, and are still more so when presented light-on-dark and with excessively wide columns. Do you know just how much more readable those sorts of pages become when you swap in a serif or sans-serif font? Try reading half an article, then swap it and go away for a few minutes so that it doesn’t feel weird, then come back and read the rest. The effect is quite remarkable.