Live data from Hacker News

Self-host your fonts for better performance

wicki.io

61–70 of 417 posts

Re: Self-host your fonts for better performance

#61
post #28

I never understood why browsers don't ship with more fonts, especially Chrome.

I'd say that it could be done one step further, even: a package in, or part of, the OS, that simply installs the 100 (or ten, I don't know the usage curves) most common fonts and keeps them updated.

Isn't that what's already happening in every OS for a very long time?

The problem that web fonts are addressing is that you have the same font across all platforms, so if some OS ship with additional fonts we'd be in the same position as before: Not everyone will have this package as part of the OS and you have an inconsistent look again.

Re: Self-host your fonts for better performance

#62

Earlier quoted context omitted.

The "cleaner" feel may well be to do with better font rendering for desktop fonts, because you'll be using something like TTF rather than WOFF. Web font files have to trade off file size for quality, which desktop fonts don't have to do.

That's not it. WOFF is just a container format for OpenType and TrueType fonts with better compression and some metadata. WOFF has nothing to do with rendering. You can achieve the exact same rendering with a WOFF file as you can with TTF; the contents are the same.

Well, TIL about it being a container. But do they really contain an identical amount of information for font rendering? I'm no font expert, but I do know that you can have more or less information in a font file that affects how it's rendered.

Re: Self-host your fonts for better performance

#63
post #4

A question: instead of redownloading the same resources again and again, can we achieve privacy by adding delay between requesting a resource and providing it? It could be the same amount of time it took downloading it the first time or some randomized value. It won't speed up pages, but at least will save from bandwidth and data caps.

[deleted]

Re: Self-host your fonts for better performance

#64

Earlier quoted context omitted.

The "cleaner" feel may well be to do with better font rendering for desktop fonts, because you'll be using something like TTF rather than WOFF. Web font files have to trade off file size for quality, which desktop fonts don't have to do.

Both Firefox and Chrome use their own font rendering, regardless of whether you're using system fonts or not.

Categorically not true in Firefox in default settings, usually disabled by websites in Chrome by using the CSS property "text-rendering: optimizeLegibility" (unless you are somehow in macOS which in this case the default preference is to optimize for precision systemwide anyway).

Re: Self-host your fonts for better performance

#65
post #23

I've always wondered the legality of downloading web fonts from Google Fonts and self-hosting them. At first glance it probably doesn't sound like a problem, I get it's effectively the same as serving them from Google, but I know fonts can also sometimes have strange licensing requirements… so I always figured it was safer just to avoid it entirely.

Many fonts really do look nice. I have shamelessly "stolen" .woff-files wherever I could find them and the license allowed it. I think Google fonts are all free to download, but don't quote me on that.

I am usually inclined to vendor dependencies on the web. Not an ideal solution but I don't like dependencies on CDNs, even if they are indeed very reliable. But apart from making sure the set has symbols for special characters you might need, it is pretty safe to do so in case of fonts and maybe even advantageous.

Also bought some fonts from other services as there are quite cheap compared to the huge amount of work going into their creation.

Re: Self-host your fonts for better performance

#66
post #47

I'd also point out that Google CDNs don't work in China and make your websites broken for 1/5th of the world's population. (Not to mention your leaking your user's info to Google - which is a dick move..)

They also don't work with, well, Chinese or most of the Asian languages for that matter. Also most of the population in Asia don't consume the web in English. So you are definitely not missing 1/5th of the world just because your fonts don't render the same, you are missing them because of no localization.

Re: Self-host your fonts for better performance

#67
post #5

I'm usually the first one to sneer in disbelief at super users who 'go nuclear' and disable the likes of javascript and images when browsing the web, but lately, I've been experimenting with having custom fonts disabled (that is, fonts I don't have locally), and it feels to me that page loads are much faster, and in some case more readable (pages feel 'cleaner'?). The only issues I've come across so far is when a sit…

Web fonts are a big one in terms of making various websites feel fast because, when implemented incorrectly, they massively slow down initial text paint. With that said, they're a fantastic feature but are also way overused. You don't need web fonts unless your website is either heavily type-centric, or has font-related dependencies (such as embedded content of some kind). Icon fonts are also a neat use of web fonts,…

> when implemented incorrectly, they massively slow down initial text paint

What are you thinking of in terms of "implemented incorrectly", do you happen to have an example?

Re: Self-host your fonts for better performance

#68
post #5

I'm usually the first one to sneer in disbelief at super users who 'go nuclear' and disable the likes of javascript and images when browsing the web, but lately, I've been experimenting with having custom fonts disabled (that is, fonts I don't have locally), and it feels to me that page loads are much faster, and in some case more readable (pages feel 'cleaner'?). The only issues I've come across so far is when a sit…

The "cleaner" feel may well be to do with better font rendering for desktop fonts, because you'll be using something like TTF rather than WOFF. Web font files have to trade off file size for quality, which desktop fonts don't have to do.

The cleaner look is because most designers use macOS which renders most fonts in a way that makes them all look good (let’s not get into technical details). On Windows the same fonts might look like shit (for example some parts of a character are thicker than the rest for no apparent reason)

Re: Self-host your fonts for better performance

#69
post #5

I'm usually the first one to sneer in disbelief at super users who 'go nuclear' and disable the likes of javascript and images when browsing the web, but lately, I've been experimenting with having custom fonts disabled (that is, fonts I don't have locally), and it feels to me that page loads are much faster, and in some case more readable (pages feel 'cleaner'?). The only issues I've come across so far is when a sit…

They are. And it is noticeable on old/slow computers. For example comparing bootstrap 2 (which uses image icons) to bootstrap 3.

On the other hand, android has only one system font, Roboto, which kind of necessitates using external fonts

Re: Self-host your fonts for better performance

#70
The convenience is the major factor. When self hosting, you have to manually take into account stuff like font format, fallbacks for older browsers, preloading considerations, hinting or no hinting, variable or not variable, and manage the (often long) CSS yourself, and keep it updated as browser compatibility and technology changes. Google does all this for you with the inclusion of a single line. But yes, the drawbacks are loss of privacy and potential for stalling if the domain serving the CSS (googleapis) is blocked or slow for some reason.
Post reply on HN