PDA

View Full Version : Problem with chinese and japanese characters display



manojmka
25th February 2010, 09:19
Hi folks,

I am changing language for my application dynamically. The language does get changed, English or German are shown perfectly. It loads corresponding translation files but I have a problem with displaying the chinese and japanese fonts on my target device. When I run my application on Linux machine, it displays all the fonts correctly, but when I run the same program with the Qt Embedded it is not displaying anything for Chinese and Japanese languages.

Here follows the code to load translators:


void FormMainWindow::changeEvent(QEvent *event)
{
if (event->type() == QEvent::LanguageChange)
retranslateUi(this);
else
QWidget::changeEvent(event);
}

void FormMainWindow::on_radioButtonGroup_buttonClicked( int id)
{
switch(id)
{
case 1:
translator.load(":/Language/TestDVR_en");
break;
case 2:
translator.load(":/Language/TestDVR_ch");
break;
case 3:
translator.load(":/Language/TestDVR_jp");
break;
case 4:
translator.load(":/Language/TestDVR_de");
break;
}
qApp->installTranslator(&translator);
}


The complete trolltech folder is deployed on /usr/local/Trolltech on my target device and application links to the same. QTDIR/lib/fonts directory on my desktop (where I develop and it is running fine) and on my target device (Qt for embedded linux) seems to be the same. I am not sure if I have to deploy some font file and load it using qApp->setFont() or do something else. I have googled a lot and searched through QtCentre forums as well.

Please provide me with some pointers. Thanks in advance.

Regards,
Manoj

manojmka
26th February 2010, 05:09
I downloaded MSGOTHIC.TTF and put it to QtDir/lib/fonts and it started showing up Japanese characters properly. I tried putting HDZB_5.TTF also but Chinese characters are still not coming up!!