[Solved] Qt text rendering issue on windows xp korean version
This is a quite old issue to me. please take a look following pictures
You can notice that the font used in menu bar and list widget looks different than others. (in korean windows xp, QApplication::font() returns “Gulim(굴림)” font by default).
now i changed style sheet like following
and the window looks different now
You see? now all pre-wierdly looked font is now rendered correctly.
For this kind of issue, in Korean Windows XP the glorious QtCreator that I’ve been wrestling with nowadays looks like…
and
please compare it with any normal other windows application in my desktop
I tried to use “-stylesheet” option when running QtCreator, but he never accepted this option. Any ideas?
—EDITED—
P.S Image itself looks as if it is rescaled in this post. In my real life it looks more ugly than it looks here…
7 replies
I found that Qt (as of 4.8) doesn’t consider the cleartype setting in windows xp.
It could get current font smoothing type configuration from registry(HKCU\Control Panel\Desktop\FontSmoothingType) and then set every font’s style strategy in qt_set_windows_font_resources() which is located in qapplication_win.cpp
- static void qt_set_windows_font_resources()
- {
- #ifndef Q_WS_WINCE
- NONCLIENTMETRICS ncm;
- ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT);
- SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize , &ncm, 0);
- LOGFONT lfIconTitleFont;
- SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfIconTitleFont), &lfIconTitleFont, 0);
As it coule be realized, every function call to qt_LOGFONTtoQFont() could return a QFont object whose styleStrategy property correctly considering mentioned registry settings. For example,
- // ### maybe move to qapplication_win
- {
- qf.setItalic(lf.lfItalic);
- if (lf.lfWeight != FW_DONTCARE)
- qf.setWeight(weightFromInteger(lf.lfWeight));
- int lfh = qAbs(lf.lfHeight);
- qf.setPointSizeF(lfh * 72.0 / GetDeviceCaps(shared_dc(),LOGPIXELSY));
- qf.setUnderline(false);
- qf.setOverline(false);
- qf.setStrikeOut(false);
- // ----- begin of mod
- const int clearTypeEnum = 2;
- if ( clearTypeEnum==s.value("FontSmoothingType",1) ) {
- }
- // ---- end of mod
- return qf;
- }
Now, I’m feeling like to report this, kinda officially, but don’t know how to.
I wish QtCreator itself could display its ui component more natuarally as well as other Qt application in my case.
Please report this on http://bugreports.qt-project.org/ ! It will get lost here… :-(
did my first bug report. here [bugreports.qt-project.org]
feels good no matter it could help or not. thanks.
You must log in to post a reply. Not a member yet? Register here!


