News for hackers. Stuff that matters.

How to make sure enough fonts are installed to display all Unicode characters?

There seem to be almost 150000 characters encoded in the latest version.

No font that I know of covers even 10% of that range. Obviously a huge amount of partial overlap between fonts exist, but likely some of the rarest characters have only a few, or perhaps one, font set that includes it.

How does anyone make sure they have enough font sets installed on their computer to cover all ~150000?

Surely it's not through manual checking of all the code points?

(I couldn't find a clear answer via searching so I hope someone has done this before!)

( 3 comments | on HN )
Re:How to make sure enough fonts are installed to display al... by abudabi123 on Thursday May 18, 2023 @10:52PM (#35997184)
You can display the hello page on Emacs and install the emacs fonts package to reduce the TOFU. Google has NOTO (no tofu) font sets but the quality is suspect at points.
Re:How to make sure enough fonts are installed to display al... by bluehorseray on Friday May 19, 2023 @12:24AM (#35997715)
Here's a stackoverflow link with a similar question: https://stackoverflow.com/questions/34732718/why-isnt-there-...

I actually don't know if there are fonts to cover every single unicode character, but I could be wrong.

I'll suggest a ridiculous hack, but could end up being a cool little project to try to get working.

I recently built a web page to display random unicode characters, and I saw that if a character isn't supported by a font it would show up as a square / rectangle.

I ended up checking to see if a character was supported by drawing the characters to HTML canvas, and then iterating through the pixels to check if it matched that square shape (there's probably a better way to do it).

You could do something similar, and then for all "unsupported" characters found, make a request to this URL with the second to last parameter being the unicode char: https://www.fileformat.info/info/unicode/char/0041/fontsuppo...

Then scrape that page for the supporting font names.

Re:How to make sure enough fonts are installed to display al... by edent on Friday May 19, 2023 @03:15AM (#35998759)