diff -r dee5afe5301f -r 3f74d0d4af4c src/gui/text/qfontengine_win.cpp --- a/src/gui/text/qfontengine_win.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/src/gui/text/qfontengine_win.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -39,6 +39,11 @@ ** ****************************************************************************/ +#if _WIN32_WINNT < 0x0500 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 +#endif + #include "qfontengine_p.h" #include "qtextengine_p.h" #include @@ -649,6 +654,30 @@ static const int char_table_entries = sizeof(char_table)/sizeof(ushort); +void QFontEngineWin::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing) +{ + HDC hdc = shared_dc(); + SelectObject(hdc, hfont); + +#ifndef Q_WS_WINCE + if (ttf) +#endif + + { + ABC abcWidths; + GetCharABCWidthsI(hdc, glyph, 1, 0, &abcWidths); + if (leftBearing) + *leftBearing = abcWidths.abcA; + if (rightBearing) + *rightBearing = abcWidths.abcC; + } + +#ifndef Q_WS_WINCE + else { + QFontEngine::getGlyphBearings(glyph, leftBearing, rightBearing); + } +#endif +} qreal QFontEngineWin::minLeftBearing() const {