PDA

View Full Version : QT4.6.3 to QT4.7.3 Font problem (Chinese)



batileon
16th June 2011, 11:17
I am having a simple QT4.6.3 program which may change language (toggle english<==> chinese)


QFont f = QFont( "Luxi Sans", 11 );
try
{
qApp->setFont( f );
app.setFont(f);
}
catch(exception e)
{
Logger logger;
logger.error("main.cpp","main()","qApp - set Font: Unknown exception" );
}


No exception was caught in the log.

After porting to QT4.7.3, I found that the Chinese font changed, like bold or set to a bigger size. I would like to know if there's any change between QT4.6 and 4.7 that leads to this problem?And, how should I correct this? I've tried setting a smaller font size and it's not working.

Thanks!

MarekR22
16th June 2011, 16:22
First check if Luxi Sans font supports Chinese glyphs.
Qt tries to use different font if some characters are not supported by given font (I heard it is called font fall back system).
It is possible that they change/improved how missing characters are resolved (by which font) and this is why you see a different fonts in those Qt versions.
IMHO it is better to use font which supports required characters/symbols.
If you like one font in English localization and another font in Chinese localization then set font in code using translatable string as a font name, so you will provide different font name for each translation.