|
Chinesse label with Qt |
Posted by Victor on Mar-16-2017 23:54 |
|
Hi.
I saw so many post & answer with unicode at labels, but nothing i read worked with Qt.
I want display a chinesse character. My code is below:
wchar_t chi[] = L"升/分钟";
c->addText(35*aux_value, 75*aux_value, WCHARtoUTF8(chi), "mingliu.ttf", 16, Chart::TextColor, Chart::Center);
But i see 3 blank squares.
i also tried
c->addText(35*aux_value, 75*aux_value, "升/分钟", "mingliu.ttf", 16, Chart::TextColor, Chart::Center);
And i got the same.
Any1 could help me?
Best regards.
|
Re: Chinesse label with Qt |
Posted by Peter Kwan on Mar-17-2017 22:03 |
|
Hi Victor,
From your screen shot, it seems the Chinese characters are recognized by ChartDirector, but it cannot draw the characters due to the font, so it just draws a square.
Is it possible the font name "mingliu.ttf" is incorrect? In my computer, the font is called "mingliu.ttc". Would you mind to check if "mingliu.ttc" is on your machine? (You can go to "c:windowsfont" to see the font file names.
Regards
Peter Kwan |
Re: Chinesse label with Qt |
Posted by Victor on Mar-17-2017 23:07 |
|
Thank you so much. i have my other fonts as .ttf, but mingliu is .ttc
Gracie mille!!!!!! |
|