font-kit icon indicating copy to clipboard operation
font-kit copied to clipboard

List writing systems supported by a font

Open RazrFalcon opened this issue 6 years ago • 4 comments

So we can check which languages/scripts can be handled by this font.

This is very useful for the font fallback resolution, when we need to find a font that can be used to write a specified text.

RazrFalcon avatar Feb 16 '19 18:02 RazrFalcon

I've started digging into this question. It's very complicated, and not easy to get direct access. I've written up some investigations as https://github.com/linebender/skribo/pull/1 and would welcome more input from experts.

raphlinus avatar Mar 04 '19 21:03 raphlinus

This is how Qt works. And similar implementations for other backends.

I've tried to implement this by myself first, but I think that there are too many edge cases of which I'm not aware of.

RazrFalcon avatar Mar 04 '19 21:03 RazrFalcon

@RazrFalcon Thanks, I'm mostly using Skia as a reference because I know it meets the needs of the web, but Qt also looks like a good source and I will dig into it. ~~Do you have any information about whether it correctly deals with Han unification on Linux, Windows, and macOS?~~ ETA: this is starting to become fairly clear reading through the source.

raphlinus avatar Mar 04 '19 21:03 raphlinus

Do you have any information about whether it correctly deals with Han unification on Linux, Windows, and macOS?

Sadly, no.

RazrFalcon avatar Mar 04 '19 21:03 RazrFalcon