Solved Chinese font issue with Qt 4.8.4 under CE 6
-
I installed Simplified Chinese on Win CE6 successfully.
I can properly see Chinese text inside a txt document on Win CE 6.I developed a test application in Qt where I use Roboto Condensed font for latin symbols. As far as I know, this font doesn't contain Chinese symbols (but I can be wrong).
When I build my application for desktop, Chinese symbols are displayed properly; maybe some kind of "font substitution" (font fallback) or another Qt mechanism takes place.
When I build my application for Win CE 6, Chinese symbols are shown as squares.
From Qt documentation, the following code
QFontDatabase fontDB; fontDB.writingSystems();
returns a sorted list of the available writing systems. This is list generated from information about all installed fonts on the system.
On my Win7 desktop
QFontDatabase::SimplifiedChinese
appears in the list.On Win CE6 it doesn't appear even if I installed Simplified Chinese.
As a consequence,
-
even if
fontDB.families()
returns a list containing SimSun both on my desktop and on Win CE6 -
fontDB.families(QFontDatabase::SimplifiedChinese)
returns SimSun on my desktop and an empty list on Win CE6
I searched inside Qt resources and I found topics on issues similar to this one: I found some suggestions, but none of them works for me.
-
-
Hi,
What did you try ?
What result did you get ?
Did you consider updating your Qt version to the latest version of available of the 4 series (4.8.7) ? -
Hi,
I installed SimSun font on Win CE 6 and I can see Chinese symbols inside a txt document on Win CE 6.
I installed my Qt application, but Chinese symbols are shown as empty squares. If I compile the same application for Desktop target, Chinese fonts are shown properly.
This is why I investigated QFontDatabas.I've been investigating if I can update Qt to 4.8.7.
Iìm not sure if this requires an update to SDK for the specific target too. -
Did you add the font to QFontDatabase ?
-
No I didn't, because
fontDB.families()
returns a list containing SimSun font both on my desktop and on Win CE6.
Is it necessary adding it explictly to QFontDatabase? -
I was able to fix the issue.
It was necessary to configure Font Linking for Roboto Condensed font as described here.On Desktop this configuration is not necessary.
-
Glad you found out and thanks for sharing !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)