Jump to content

[SOLVED]Problem with applying a local language


photo

Recommended Posts

Posted

Hello,

I have a problem on applying a text with an local language.

I am looking for a way to show a text in Korean with Unigine Engine.

I made a text object and apply "NGULIM.TTF" file which helps creating korean language on it.

There is a problem on coding base work. but, it works well on Unigine engine editer.

hiworks_20200506_1454.PNG.7c823a90fb8bd15c10438a12859cf437.PNG

The top left letter of the picture is what my code makes, and the letters "가나다라" is what I made on Unigine Engine Editer.

My code is here:

Unigine::ObjectTextPtr text = Unigine::ObjectText::create();

    //change font
    text->setFontName(_T("NGULIM.TTF"));

    //change text
    text->setText(_T("가나다라"));

    //change font size
    text->setFontSize(40);

    //change transform
    text->setRotation(Unigine::Math::quat(90.0, 0, 0.0f));
    text->setPosition(Unigine::Math::vec3(0.0f, 0.0f, 1.0f));

    //give world to owner
    text->release();

 

ps. Engine Version - UNIGINE 2 ENTERTAINMENT 2.7.2.1 

NGULIM.TTF

Posted

Following code works fine if your source file is saved with UTF-8 encoding (without BOM):

#include <codecvt>

Unigine::ObjectTextPtr text = Unigine::ObjectText::create();

//change font
text->setFontName("NGULIM.TTF");

//change text
text->setText(u8"가나다라");

//change font size
text->setFontSize(40);

//change transform
text->setRotation(Unigine::Math::quat(90.0, 0, 0.0f));
text->setPosition(Unigine::Math::vec3(0.0f, 0.0f, 1.0f));

//give world to owner
text->release();

image.png

  • Like 2

How to submit a good bug report
---
FTP server for test scenes and user uploads:

  • adgsf432 changed the title to [SOLVED]Problem with applying a local language
×
×
  • Create New...