Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How does Qt/Embedded load multi fonts
leasia last edited by
My Qt/E library version is 4.6.2, and the base platform is embedded linux, without X11 system.
By default, QFontDatabasePrivate will index all the fonts that in directory QTEDIR/lib/fonts, and QApplication will set default font "DejaVu Sans".
There is no Chinese characters in "DejaVu Sans", so my application can't display Chinese. Then I add some "wenquanyi" fonts to directory QTEDIR/lib/fonts, but Qt can't use it functionally, I have to call setFont function in main function or add para "-font wenquanyi" when start my application. I think it is not very flexible.
If my language enviroment is English, all the Chinese website can't display normally; If I set system font with "wenquanyi", the Latin characters are unbeautiful. Further, every font can't contain all the languages that we need, so there are multi requisite fonts in my system (for example: DejaVu Sans, wenquanyi, Korean and so on). I don't know how to solve this problem.
How can I load multi font for QApplication? I want to use DejaVu Sans by default, when some UI pages have chinese characters, Qt will load and use "wenquanyi" automatic. How can I do? Or is there any other method to solve it?