Thread overview
could someone test support for Asian languages in nanogui port?
May 04
drug
May 06
drug
May 08
Kagamin
May 08
drug
May 04
I port nanogui, but besides porting I'd like to improve it using great capabilities of D language provides. One of them is utf support, so I added support for Asian languages to nanogui.TextBox. But I'm not sure I've did it well and so I'd like to ask someone to test it using the following:
```
git clone --recursive https://github.com/drug007/nanogui.git
cd nanogui
git checkout textbox # TextBox exists in this branch only
dub --config=sdl # Keyboard events provided only by SDL2 backend only
```

On the right side there will be a window with four text boxes with russian, english, japanese and chinese text respectively. It would be nice to get some feedback from users - probably I did something totally wrong. Also I'm curious does it worth efforts?
May 06
On Friday, 4 May 2018 at 10:40:52 UTC, drug wrote:
> I port nanogui, but besides porting I'd like to improve it using great capabilities of D language provides. One of them is utf support, so I added support for Asian languages to nanogui.TextBox. But I'm not sure I've did it well and so I'd like to ask someone to test it using the following:
> ```
> git clone --recursive https://github.com/drug007/nanogui.git
> cd nanogui
> git checkout textbox # TextBox exists in this branch only
> dub --config=sdl # Keyboard events provided only by SDL2 backend only
> ```
>
> On the right side there will be a window with four text boxes with russian, english, japanese and chinese text respectively. It would be nice to get some feedback from users - probably I did something totally wrong. Also I'm curious does it worth efforts?

hi,

I'm a Chinese, and I just have done the test. I also copied some Japanese text from Dlang twitter channel and added some Chinese wide punctuation Char.

And It's all seems displayed correctly.

The resulting screenshot is here:  https://pasteboard.co/HjRmOYg.png

The only problem is that the font style simply looks strange. You can see the 'normal' text display in Win10 by default like this:  https://pasteboard.co/HjRrigh.png

And the font problem is probably related to SDL or GL, for all UI based on GL or SDL, they all have the same problem. Dlangui also has the same situation, that's why I just did not use Dlangui for a production project.

But, Anyway, the text is displayed correctly.

Great work for doing this! Dlang needs a great GUI framework.
May 06
On 06.05.2018 06:10, Binghoo Dang wrote:
> 
> hi,
> 
> I'm a Chinese, and I just have done the test. I also copied some Japanese text from Dlang twitter channel and added some Chinese wide punctuation Char.
> 
> And It's all seems displayed correctly.
> 
> The resulting screenshot is here: https://pasteboard.co/HjRmOYg.png
> 
> The only problem is that the font style simply looks strange. You can see the 'normal' text display in Win10 by default like this: https://pasteboard.co/HjRrigh.png

Can it fixed by other font or there are some other problems?

> 
> And the font problem is probably related to SDL or GL, for all UI based on GL or SDL, they all have the same problem. Dlangui also has the same situation, that's why I just did not use Dlangui for a production project.

Could you describe the problem in more details?

> 
> But, Anyway, the text is displayed correctly.
> 
> Great work for doing this! Dlang needs a great GUI framework.

Thank you for your time!

May 08
On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
> Could you describe the problem in more details?

SDL probably selects the first font that has the characters, which in his case is a font of comic sans design, instead of a font configured for gui.
May 08
08.05.2018 11:11, Kagamin пишет:
> On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
>> Could you describe the problem in more details?
> 
> SDL probably selects the first font that has the characters, which in his case is a font of comic sans design, instead of a font configured for gui.

It's not the case, the font is set explicitly, so may be other font can solve the problem.

Also text is rendered by nanovega, not by SDL. nanovega uses FontStash, lowlevel font engine that in its turn uses either freetype or stb (there are three (!) implementations of it: stb port, arsd and iv, probably all of them just are variants of original std)
December 07
On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
> On 06.05.2018 06:10, Binghoo Dang wrote:
>> 
>> hi,
>> 
>> I'm a Chinese, and I just have done the test. I also copied some Japanese text from Dlang twitter channel and added some Chinese wide punctuation Char.
>> 
>> And It's all seems displayed correctly.
>> 
>> The resulting screenshot is here: https://pasteboard.co/HjRmOYg.png
>> 
>> The only problem is that the font style simply looks strange. You can see the 'normal' text display in Win10 by default like this: https://pasteboard.co/HjRrigh.png
>
> Can it fixed by other font or there are some other problems?
>

yeah, the bad font display can be resolved after setting a CJK font(I just replaced with msyh.ttf).

the result is like this: https://pasteboard.co/HQBdP14.png

thanks!