Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Chinese characters don't work when using custom platform abstraction with QGenericUnixFontDatabase
theonlylawislove last edited by theonlylawislove
I have a custom platform abstraction (based off of the minimal example), that uses the
I have UTF-16 strings.
When I try to render this: just漢atest
It shows up as this: justatest
painter.drawText(0, 0, width(), height(), Qt::AlignCenter, utf16string);
This displays correct on Ubuntu and Windows platforms.
When I enumerator the available fonts on my embedded system, I get these results.
"Bitstream Charter" "Bitstream Vera Sans" "Bitstream Vera Sans Mono" "Bitstream Vera Serif" "Courier" "Courier 10 Pitch" "Cursor" "DejaVu Sans" "DejaVu Sans Mono" "DejaVu Serif" "Luxi Mono" "Luxi Sans" "Luxi Serif" "Utopia"
Should I be using only certain fonts?
I am using Qt 5.3.2. I have to use this version because of my Yocto embedded environment.
UPDATE: I tried using every font available on the system, and non worked.
painter.setFont(QFont("Utopia", 10, QFont::Bold));
You'll likely have to add a font that supports Chinese characters to your system.