Hacker News new | ask | show | jobs
by WorldMaker 2506 days ago
The usual advice is that you make sure you have plenty of font fallback options that may already be on the user's machine, and why most CSS font-family snippets always end in a wide, generic display class such as "serif" and "sans-serif".

In general, it's hard to break browser fallback to system fonts for languages/glyphs that aren't available. (Though people will sometimes try, or make crazy bad accidents happen.)

But, you mostly only have to worry about languages your webpage is outputting anyway. If you aren't localizing to a particular language and you don't allow user content, you don't have to worry about a web font covering those glyphs. Which is why most web fonts only worry about the top few languages for download speed optimization.

Google Fonts has tools to be smarter about which subsets are downloaded in a browser. It has a subset hint where you can tell it languages you think you will need. Google Fonts also supports the use of the unicode-range CSS feature [0] to tell a browser to download subsets only if the browser encounters characters in the associated Unicode ranges.

[0] https://caniuse.com/#feat=font-unicode-range