Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, but the browser should be equipped to make that happen as quickly as possible.
Of course, servers should still be capable of serving the fonts that the client requires to render the content correctly, but the browser should be equipped to make that happen as quickly as possible.
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 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 Google Fonts service.
For a good technical reason: the version installed on the computer may not really match whatever the version on Google Fonts serves (fonts have notoriously no semantic versioning aside from some programmer-oriented fonts, examples of these outside are Segoe UI (changed between Windows 7 and 8) and Liberation fonts (some versions notoriously lack some glyph symbols) and on Google Fonts platform the Exo and Exo 2 problem (which was resolved by renaming the second version to Exo 2)).
Of course, there are also some benefits to Google (you know what are those benefits are).
When you select fonts on Google Fonts, the website instructs you to link to CSS hosted by Google, which is simple to implement, but not performant. Really, you would want to load that CSS asynchronously, so that the rendering of the whole website doesn't wait for Google Fonts. (Here's how you load CSS asynchronously, by the way: https://stackoverflow.com/q/32759272/247696 ) Or even better, host the fonts yourself.
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.
https://fonts.googleapis.com/css2?family=Inconsolata&display...
@font-face {
font-family: 'Inconsolata';
...
src: url(https://fonts.gstatic.com/s/inconsolata/....woff2) format('woff2');
unicode-range: U+0000-00FF, ...;Some random references to it w/ the snippets:
https://stackoverflow.com/a/52413970
https://stackoverflow.com/questions/18303215/how-can-i-preve...
I've created issue "Local font name makes web accessible", and I hope it would be fixed.
- 1. Copyright (though many fonts are free, true)
- 2. Everyone uses a different font (just like everyone uses a slightly different version jquery) so cache hit would be pretty small IMO. Do you really want a browser to be gigabytes large? Especially on mobile it's not viable
Maybe if browsers standardized on shipping, say, 20 carefully chosen fonts (not necessarily the most popular ones, just a good variety of different types of fonts), the smaller websites would follow and use them; but I think any major brand likes to distinguish themselves and have a custom unique font.
Web standards and browser features are generally built for the long term and backward compatibility. I mean, it's not impossible to find a solution, but it's definitely not "let's download some fonts and bundle with the browser, done" kind of problem.
It may be not really carefully chosen, but didn't Microsoft have done this already? (Core fonts for the Web, https://web.archive.org/web/20020124085641/http://www.micros...). The reason they have discontinued this programme is that it actually costs them some money (as the fonts are not owned by Microsoft.)
Also, how would you cater to non-LGC (Latin, Greek, Cyrillic) users?
Absolutely, i would rather give the browser 50 GB even on my phone over paying my mobile operator for downloading the same data over and over again.
And it wouldn't take anywhere near that much, I am sure 80% of most used fonts are only a couple dozen, that wouldn't tale gigabytes
For example, Google Maps by default doesn't load maps of the entire world when you install it. However, it does let you opt-in to pre-downloading specific areas that you frequently travel.
Browsers could do the same by simply adding an opt-in to download / cache common assets like fonts, jquery, etc.
Not embedding all of them would allow tracking. Caching all web fonts would allow tracking.
The solution is embedding all the popular ones so everyone has them and it can't be used as a signal.
https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-...
so it should be possible to log. And given a list it is not hard to download.
Self-hosting is the way to go since it gives you full artistic control and you can use things like the Unicode-range CSS property to tell clients how to combine smaller fonts so you can support many languages without forcing a French browser to download a ton of Chinese glyphs which aren’t used on the page.
Another nice option we have now is using font-display to allow using a similar system font until downloads are completed, which can work really well for slow connections:
https://calendar.perfplanet.com/2020/a-font-display-setting-...
Correct me if I'm misunderstanding, but don't the vast majority of fonts _not_ include full Unicode support, or even close to it? I know of GNU Unifont, but not many people are using that on the web...
I take your point on selectively downloading the relevant glyphs for the user's locale, but this could be done by the browser too - it is aware of the locale.
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.
I could learn how to do it in 30 minutes, but I don't feel like spending 30 minutes learning that.
I'd guess that 99% of users don't know how to install fonts or simply don't care about it enough to their spend time installing fonts.