diff options
author | David Boddie <david.boddie@nokia.com> | 2011-05-03 16:25:39 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-05-03 16:25:39 (GMT) |
commit | ac0a7503d58946b38d4d18bb077dd9530ccbb6f9 (patch) | |
tree | 3e16b713e0269147f9d362e7c1384768e98b2c1e /src/gui/text/qfont_win.cpp | |
parent | bf0926fff333398660fd51ae6b08699783100057 (diff) | |
parent | 399782c7911c11bba80dd37276f8de0b171c52f8 (diff) | |
download | Qt-ac0a7503d58946b38d4d18bb077dd9530ccbb6f9.zip Qt-ac0a7503d58946b38d4d18bb077dd9530ccbb6f9.tar.gz Qt-ac0a7503d58946b38d4d18bb077dd9530ccbb6f9.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/text/qfont_win.cpp')
-rw-r--r-- | src/gui/text/qfont_win.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/gui/text/qfont_win.cpp b/src/gui/text/qfont_win.cpp index 7d710ea..3ef761b 100644 --- a/src/gui/text/qfont_win.cpp +++ b/src/gui/text/qfont_win.cpp @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE extern HDC shared_dc(); // common dc for all fonts +extern QFont::Weight weightFromInteger(int weight); // qfontdatabase.cpp // ### maybe move to qapplication_win QFont qt_LOGFONTtoQFont(LOGFONT& lf, bool /*scale*/) @@ -65,20 +66,8 @@ QFont qt_LOGFONTtoQFont(LOGFONT& lf, bool /*scale*/) QString family = QString::fromWCharArray(lf.lfFaceName); QFont qf(family); qf.setItalic(lf.lfItalic); - if (lf.lfWeight != FW_DONTCARE) { - int weight; - if (lf.lfWeight < 400) - weight = QFont::Light; - else if (lf.lfWeight < 600) - weight = QFont::Normal; - else if (lf.lfWeight < 700) - weight = QFont::DemiBold; - else if (lf.lfWeight < 800) - weight = QFont::Bold; - else - weight = QFont::Black; - qf.setWeight(weight); - } + 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); |