orbtk icon indicating copy to clipboard operation
orbtk copied to clipboard

TextBlock text() set Chinese characters not displayed

Open litttley opened this issue 4 years ago • 4 comments

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

litttley avatar Feb 28 '20 14:02 litttley

The problem is not only Chinese. I tried several languages:

image

.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

usagi avatar Mar 09 '20 11:03 usagi

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.

FloVanGH avatar Mar 09 '20 12:03 FloVanGH

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.

kivimango avatar May 10 '20 18:05 kivimango

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.

sftblw avatar Jan 14 '21 13:01 sftblw