Is this the right solution to the language problem?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Is this the right solution to the language problem?

Post by Pinic »

Is this the right solution to the language problem? Sorry that without translation)

Если у кого проблеммы с вводом русского (или какого другого) текста, то вот солюшн:
В исходниках движка в файле CIrrDeviceWin32.cpp на примерно 200-ой строчке меняем
WORD KeyAsc=0;
на
WCHAR KeyUni=0;
ниже строчку
ToAscii(wParam,lParam,allKeys,&KeyAsc,0);
меняем на
ToUnicode(wParam,lParam,allKeys,&KeyUni,1,0);
пересобираем библиотеку, ложим в нужное место либу и dll (а может можно и просто dll...) и радуемся:)
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Is this the right solution to the language problem?

Post by MartinVee »

You can use Google Translate when you want to pass information around.
If anyone has problems with the introduction of Russian (or some other) text, here is the solution:
In the source code of the engine in the file CIrrDeviceWin32.cpp on the approximately 200th line, we change
WORD KeyAsc = 0;
on
WCHAR KeyUni = 0;
Below line
ToAscii (wParam, lParam, allKeys, & KeyAsc, 0);
change to
ToUnicode (wParam, lParam, allKeys, & KeyUni, 1.0);
rebuild the library, we put the lib and dll in the right place (or maybe just dll ...) and are happy :)
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Re: Is this the right solution to the language problem?

Post by Pinic »

Is the solution?

If someone has problems with typing in Russian (or any other) text, here's the solution:
In the source code of the engine in the file CIrrDeviceWin32.cpp at about 200-th line change
WORD KeyAsc = 0;
on
WCHAR KeyUni = 0;
the line below
ToAscii (wParam, lParam, allKeys, & KeyAsc, 0);
change to
ToUnicode (wParam, lParam, allKeys, & KeyUni, 1,0);
rebuild the library, put in the right place Libu and dll (and maybe you can just dll ...) and rejoice :)
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Is this the right solution to the language problem?

Post by CuteAlien »

It's one solution I guess. Thougt we use ToAsciiEx since Irrlicht 1.7, so it looks like you run a very old Irrlicht version.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Re: Is this the right solution to the language problem?

Post by Pinic »

And how to do on the new version?
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Is this the right solution to the language problem?

Post by CuteAlien »

It should work already I think.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Re: Is this the right solution to the language problem?

Post by Pinic »

I can't solve my language problem. I upload Russian fonts but they are not displayed. What to do who can that prompt?
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Is this the right solution to the language problem?

Post by devsh »

Irrlicht GUI by default only creates a font atlas for most used Unicode characters... I believe Russian codes are not in that atlas and thats the source of your problem.

However I have very little experience with Irrlicht GUI.
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Is this the right solution to the language problem?

Post by CuteAlien »

I used russian fonts before, they should work. But can't tell much without seeing font-file and code-example.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Re: Is this the right solution to the language problem?

Post by Pinic »

Шрифты создал с помощью программы IrrFont которая находится в папках с движком код gui и загрузки шрифтов из примера irrlicht. Написал " -2018" отобразились только цифры.

Fonts created with this program IrrFont which is in the folder with the engine. gui code and download fonts from the irrlicht example. Wrote "Дэмо игра - 2018" display only numbers.
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Is this the right solution to the language problem?

Post by CuteAlien »

And which Irrlicht Version?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pinic
Posts: 21
Joined: Wed Mar 07, 2018 10:55 am

Re: Is this the right solution to the language problem?

Post by Pinic »

1.8.4
Maybe I somehow do not load correctly?Can you tell me the code to download the fonts?
CuteAlien
Admin
Posts: 9646
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Is this the right solution to the language problem?

Post by CuteAlien »

Wait - did you use the font from the Irrlicht example? That one has no cyrillic characters. Otherwise - please tell me which font you used. Example which works for me: https://bitbucket.org/mzeilfelder/irr-p ... ew-default

The corresponding font is droid_sans12.xml in this folder: https://bitbucket.org/mzeilfelder/irr-p ... at=default
(the bmp one doesn't work, not sure right now why). The font was created with the Irrlicht font tool.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply