News for hackers. Stuff that matters.
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.

There are no comments on this comment yet.