orbtk
orbtk copied to clipboard
TextBlock text() set Chinese characters not displayed
TextBlock::create() .text("测试test")
.font_size(48.0)
/*.font("font_text")*/
/* .selector("color_text")*/
.height(20.0)
.margin((100.0, 4.0, 10.0, 4.0))//边距左上右下
/* .horizontal_alignment("center")
.vertical_alignment("center")*/
.build(ctx),
the chinese characters "测试" cannot be displayed
The problem is not only Chinese. I tried several languages:
.text("Orb てつさび(ja) 鐵鏽(tw) 铁锈(cn) 녹(ko) Σκουριά(el) ржавчина(ru) Médecine(fr) ยา(th) Tk")
- GOOD: English, Greek, Russian, French
- NO GOOD: Japanese, Chinese(Traditional, Simplified), Korean, Thai
At the moment we uses the Roboto Font, but it does not provide for languages like Chinese. I will try the Noto font, that supports many languages.
I tried NotoSans Regular & Medium, greek, french and russian letters are showing up, but the other language's characters are replaced by the so-called "tofu"s. There is a Noto CJK font, but not in .ttf format.
I tried korean-specific font (NanumGothic.ttf) to know why CJK is not displayed (by temporary replacing default theme and resources on master branch bc5dc9af) but It worked...
Maybe system font fallback would be great to have. Looks like font-kit supports it.