Closed teminian closed 2 years ago
Thanks for the detailed report!
On Windows we're using IDWriteFontFallback::MapCharacters to determine the list of fonts we need to render a given piece of text. When that text starts with Korean characters, we locate the correct font. When it starts with latin, we either fail to pick the correct fallback font or the font we pick claims to cover CJK when in fact it doesn't.
This is also reproducible with Chinese characters, so this is most likely related to us calling the function incorrect or interpreting the results wrongly.
The implementation returns only a single font ever, so there's definitely something fishy there.
I can reproduce on Linux btw
(string: "e.g. 가나다라DDDDjjjj")
Edit: I think I just don't have the character in my fonts. Because Qt is also not showing it. And even in the browser it is replacement character.
I agree with @ogoffart. I think you can install a few Korean fonts in Linux and try again, for example Nanum. For Ubuntu the package name must be fonts-nanum and for Fedora and like I think it's nhn-nanum-fonts.
It can be used in the font of the following address.
https://hangeul.naver.com/hangeul_static/webfont/zips/nanum-myeongjo.zip
The prefix 'nanum' means open, and all nanum fonts follow the open source license. Because the default font is already used, Hangul(Korean characters) is shown as squares. To use Hangul, the font was changed by adding "NanumGothic" to default-font-family. Add below parameter
default-font-family: "NanumMyeongjo";
in gallery.slint file.
The implementation returns only a single font ever, so there's definitely something fishy there.
What's fishy is that we're not looking at the valid_len field.
If you follow instructions below, you find that Korean characters are shown as squares(as if there's no such font)
As of current the only workaround is as follows:
For your reference, I used OpenGL backend in Windows, and the language is C++.