Chinese font in Qt application under Win CE6

I followed this KB document and 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” or another Qt mechanism takes place.

When I build my application for Win CE 6, Chinese symbols are shown as squares.

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.

Does someone know the right way to handle Chinese chracters in a Qt application on Win CE 6 on Toradex modules?

I add an additional information:

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 described in the KB.

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

Are you sure that some additional step is not missing in the procedure described in Toradex KB?

Dear @vix,

Thank you for contacting support. I would like to suggest you a quick idea, did you import the font on the application, please have a look at the reference project and let me know if it helps you. I didn’t really dig into QT, if it didn’t help then I will look into QT and get back to you.

Hi @raja.tx

I downloaded the project and I had a look, but it’s not 100% clear to me what I should do.

Should I cross compile it for CE 6, run it and see what happens?

Dear @vix,

Please try AddFontResource API on your application, is that makes any difference?

You can compile it for CE6 and check what all are fonts installed on the module.

Hi @raja.tx

adding AddFontResource API didn’t fix the issue.

After a deeper investigation I found how to fix:

I had to configure Font Linking properly on Win CE 6 for Roboto Condensed font.

I had to add a key for Roboto Condensed to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink], based on what it’s described here.

I don’t need switching between different languages in the OS, so I didn’t modify [HKEY_CURRENT_USER\MUI].

But it’s necessary to add font mapping for every custom font you need in your UI.

I don’t know why Win7 Desktop doesn’t need this.

Hi @raja.tx

adding AddFontResource API didn’t fix the issue.

After a deeper investigation I found how to fix:

I had to configure Font Linking properly on Win CE 6 for Roboto Condensed font.

I had to add a key for Roboto Condensed to [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FontLink\SystemLink], based on what it’s described here.

I don’t need switching between different languages in the OS, so I didn’t modify [HKEY_CURRENT_USER\MUI].

But it’s necessary to add font mapping for every custom font you need in your UI.

I don’t know why Win7 Desktop doesn’t need this.