Live data from Hacker News

Self-host your fonts for better performance

wicki.io

371–380 of 417 posts

Re: Self-host your fonts for better performance

#371
post #2

LocalCDN (Firefox Extension) solves the performance issue on the client side, i assume: https://addons.mozilla.org/en-US/firefox/addon/localcdn-fork... https://codeberg.org/nobody/LocalCDN/src/branch/main/resourc... (and adds extra privacy as a bonus.)

Note that LocalCDN doesn't handle Google Fonts:

https://codeberg.org/nobody/LocalCDN/issues/159

Re: Self-host your fonts for better performance

#372
post #283

Earlier quoted context omitted.

uMatrix is uBlock Origin (uBO) with 2 differences: 1) No cosmetic filtering. 2) A more powerful interface, as _underfl0w_ describes at https://news.ycombinator.com/item?id=25302405 The key thing which that comment does not mention is that the interface enables a whitelist approach — block everything (read: as much as you want) by default and selectively allow certain types of content from certain sites. This is impor…

Actually, you _can_ configure uBO to block third-party content by default (by turning on advanced user mode); however, it's not as good as uMatrix as there is no split of request type (script versus image, etc.) as well as no UI to manage subdomains. You'll have to do that last part by editing the text configuration manually.

> no UI to manage subdomains

You can expand any base domain to see subdomains -- click where there is no text. You can also click the "all" cell to expand to see all subdomains.

Re: Self-host your fonts for better performance

#373
post #366

Earlier quoted context omitted.

The secret of democracy is that, even when there are no good options to choose from, people agreed on the solution. Therefore you are not a the whim of a single person or entity and this legitimates the way you live. As for technology existing only because of Google or some other large company, that's not the case. Google was more innovative when it was smaller. Netscape created the whole browser industry as a small…

> The secret of democracy is that, even when there are no good options to choose from, people agreed on the solution. No, a plurality of people agreed on the solution, and everyone else disagreed with it but was stuck with it. > Therefore you are not a the whim of a single person or entity and this legitimates the way you live. Now you're at the whim of a popularity contest.

Yeah, to me the solution is configurability with sensible defaults. It increases the work of the developers, but it has the benefit of reducing the number of decisions the developers have to make on behalf of the user.

Re: Self-host your fonts for better performance

#374
post #2

LocalCDN (Firefox Extension) solves the performance issue on the client side, i assume: https://addons.mozilla.org/en-US/firefox/addon/localcdn-fork... https://codeberg.org/nobody/LocalCDN/src/branch/main/resourc... (and adds extra privacy as a bonus.)

Keep in mind that this currently breaks SOP/CORS which can break some webpages.

Re: Self-host your fonts for better performance

#375
post #280
post #225

Earlier quoted context omitted.

That'd break sites that use ligature-based icon fonts, with the actual content being an icon identifier like "thumbs-up" and an OpenType ligature rule in the font to render this as an icon glyph.

Could you just get the icon name in that case? For me it would be good-enough, or, in many cases, better than the crammed design-first icons (Slack, I'm pointing at you!).

In theory, it's legible; but often, rendering the icon name (which may be up to a dozen letters or so) will totally break a layout that was designed to accommodate a single glyph.

Re: Self-host your fonts for better performance

#376

Earlier quoted context omitted.

I've sped up sites before by using inline svg rather than icon fonts - downloading an entire icon font for a few icons is inefficient when the actual SVG needed for those icons is < 1Kb and is waaay faster as inline SVG.

It's only faster on the first load. On all subsequent loads its slower and consumes more bandwidth. I find this irresponsible.

1. If you use, say, 5 icons and there are, say, 250 icons in the full font, then you would need to download the page 50 times to just equal the bandwidth. That's assuming the cache doesn't expire, or it's not an incognito session, or you're not loading it from a CDN where it won't get cached anyway.

2. If you do find this irresponsible, then by all means create a small SVG file with the 5 icons in it and allow that to be cached, or even 5 small individual SVG files if it comes to that.

Re: Self-host your fonts for better performance

#377
post #367

Earlier quoted context omitted.

There are so many solutions! * In uBlock Origin (which is a must have on bad internet): Settings > Block remote fonts * In browser, Firefox about:config, gfx.downloadable_fonts.enabled, Chrome run with --disable-remote-fonts * Download fonts when on good connection > You can download all Google Fonts in a simple ZIP snapshot (over 300MB) > https://github.com/google/fonts installation depends on OS, on Arch Linux it w…

Are you just clinging to the last dev version of uMatrix, or did you find an active fork or something?

I use last one, it works and I've implemented shortcut to relax restrictions

https://github.com/sergeykish/uMatrix/commit/929a25e39fc1d38...

Re: Self-host your fonts for better performance

#378

Earlier quoted context omitted.

Most sites are still usable if you cherry pick a subset of the JS they invoke. Blocked trackers like Google analytics or tag manager rarely break things.

Except for sites that I use (internal websites for several vendors), and that is just to manipulate widgets, editors, and forms, and in one case, operate remote machinery. What methods for cherry picking do you like? I've only done all or nothing.

I use NoScript to whitelist a minimal set of what needs to be there. I won't ever allow analytics or doubleclick scripts. When I pop into a media site with 20+ third party scripts I just say nope and spend my time somewhere else. For basket case sites needed for work or e-commerce that are too fubared to work with script blocking I have a clean Chrome browser. None of those sites get to have tracking cookies from my main browser instance.

Re: Self-host your fonts for better performance

#379

Earlier quoted context omitted.

> That might be due to font hinting. The default fonts (on Windows) were beautifully manually hinted to give a really crisp results without font smoothing. I used to work at MS, and a lot of people don't realize exactly how much time, money, and love is put into fonts there. When my team ordered custom fonts, I personally spent a lot of time going over each character pixel by pixel, in combination with many other cha…

Just want to say that I really appreciate you and people like you. I can spend hours looking over and comparing fonts I use because small problems can really bug me, no pun intended.

Moving to web development was jarring.

Same platform, different browsers, fonts render differently.

Different platform, same browser, fonts render differently.

Same computer, same browser, laptop monitor vs external, fonts render differently.

Same font, same computer, web browser vs local application, fonts render differently.

It is madness.

Re: Self-host your fonts for better performance

#380

Earlier quoted context omitted.

Selling fonts is not rent-seeking. Rent-seeking would be if Google demanded money from a font designer to let their fonts be "compatible" with Chrome. I.e. Pay me or I'll make sure your product doesn't work with my product. App stores is a common example; pay Apple or they'll make sure your software doesn't run on the iPhone.

Some features of the license agreement are though. For example, some foundries require you buy a special expensive license in order to use their fonts in a PDF. IIRC, Hoefler & Co. and Emigre do this (though it's been years since I've looked, so I may have changed this). Their rationale is that since it's possible to extract font from a PDF, they need to pay for any font piracy that results from that. (never mind tha…

You may not like it, neither do I. But what you have there is just rent plain and simple, not rent-seeking.

Rent-seeking is when a third party uses force to claim profit from an agreement they're not actually party to.

For example, you rent a business property. You pay the landlord and agree to their terms. Next week the mob shows up and demand protection money to "keep you from harm". Implying that harm will surely come to you unless you pay. That's rent-seeking.

The app store analogy fits rather nicely I think, but it depends on your viewpoint.

Post reply on HN