adgsf432 Posted May 6, 2020 Posted May 6, 2020 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. 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
silent Posted May 6, 2020 Posted May 6, 2020 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(); 2 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Recommended Posts