diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index ef93094..466835b 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -741,7 +741,9 @@ void QPaintEngine::drawPath(const QPainterPath &)
 
 void QPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
 {
+
     const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+    qDebug() << __FUNCTION__ << p << ti.chars;
 
     QPainterPath path;
     path.setFillRule(Qt::WindingFill);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index e80c013..ae5c6ca 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
 #define QGradient_StretchToDevice 0x10000000
 #define QPaintEngine_OpaqueBackground 0x40000000
 
-// #define QT_DEBUG_DRAW
+#define QT_DEBUG_DRAW
 #ifdef QT_DEBUG_DRAW
 bool qt_show_painter_debug_output = true;
 #endif
@@ -6378,6 +6378,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
         printf("QPainter::drawTextItem(), pos=[%.f,%.f], str='%s'\n",
                p.x(), p.y(), qPrintable(_ti.text()));
 #endif
+    qDebug() << __FUNCTION__ << '>' << _ti.text();
 
     Q_Q(QPainter);
 
@@ -6427,6 +6428,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
             q->setRenderHint(QPainter::Antialiasing, true);
     }
 
+    qDebug() << __FUNCTION__ << "extended=" << extended <<"state=" << state;
     if (!extended)
         updateState(state);
 
@@ -6435,8 +6437,9 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
     } else if (ti.fontEngine->type() == QFontEngine::Multi) {
         QFontEngineMulti *multi = static_cast<QFontEngineMulti *>(ti.fontEngine);
 
-        const QGlyphLayout &glyphs = ti.glyphs;
+        const QGlyphLayout &glyphs = ti.glyphs;        
         int which = glyphs.glyphs[0] >> 24;
+        qDebug() << __FUNCTION__ << "QFontEngine::Multi which=" << which;
 
         qreal x = p.x();
         qreal y = p.y();
@@ -6448,6 +6451,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
         int start = 0;
         int end, i;
         for (end = 0; end < ti.glyphs.numGlyphs; ++end) {
+            qDebug() << __FUNCTION__ << "start=" << start << "end=" << end << "x=" << x;
             const int e = glyphs.glyphs[end] >> 24;
             if (e == which)
                 continue;
@@ -6459,6 +6463,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
             // set the high byte to zero and calc the width
             for (i = start; i < end; ++i) {
                 glyphs.glyphs[i] = glyphs.glyphs[i] & 0xffffff;
+                qDebug() << __FUNCTION__ << "i=" << i <<"glyphs=" << glyphs.glyphs[i] << "effectiveAdvance=" << ti.glyphs.effectiveAdvance(i);
                 ti2.width += ti.glyphs.effectiveAdvance(i);
             }
 
@@ -6470,8 +6475,10 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
             else
                 engine->drawTextItem(QPointF(x, y), ti2);
 
-            if (!rtl)
+            if (!rtl) {
+                qDebug() << "width=" << ti2.width;
                 x += ti2.width.toReal();
+            }
 
             // reset the high byte for all glyphs and advance to the next sub-string
             const int hi = which << 24;
@@ -6482,6 +6489,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
             // change engine
             start = end;
             which = e;
+            qDebug() << __FUNCTION__ << "loop bottom start=" << start << "which=" << which;
         }
 
         multi->ensureEngineAt(which);
@@ -6490,6 +6498,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
         // set the high byte to zero and calc the width
         for (i = start; i < end; ++i) {
             glyphs.glyphs[i] = glyphs.glyphs[i] & 0xffffff;
+            qDebug() << __FUNCTION__ << "l2 i=" << i <<"glyphs=" << glyphs.glyphs[i] << "effectiveAdvance=" << ti.glyphs.effectiveAdvance(i);
             ti2.width += ti.glyphs.effectiveAdvance(i);
         }
 
@@ -6522,6 +6531,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText
         else
             state->dirtyFlags |= QPaintEngine::DirtyHints;
     }
+    qDebug() << __FUNCTION__ << '<' << _ti.text();
 }
 
 /*!
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 6b98c14..7286b72 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -949,9 +949,10 @@ extern bool qt_useHarfbuzzNG(); // defined in qfontengine.cpp
 
 void QTextEngine::shapeText(int item) const
 {
+
     Q_ASSERT(item < layoutData->items.size());
     QScriptItem &si = layoutData->items[item];
-
+    qDebug() << __FUNCTION__ << "item=" << item << si;
     if (si.num_glyphs)
         return;
 
@@ -991,6 +992,7 @@ void QTextEngine::shapeText(int item) const
     }
 
     QFontEngine *fontEngine = this->fontEngine(si, &si.ascent, &si.descent, &si.leading);
+    qDebug() << __FUNCTION__ << si << "fontEngine" << fontEngine << "type=" << fontEngine->type();
 
     // split up the item into parts that come from different font engines
     // k * 3 entries, array[k] == index in string, array[k + 1] == index in glyphs, array[k + 2] == engine index
@@ -1000,6 +1002,7 @@ void QTextEngine::shapeText(int item) const
         // ask the font engine to find out which glyphs (as an index in the specific font)
         // to use for the text in one item.
         QGlyphLayout initialGlyphs = availableGlyphs(&si);
+        qDebug() << __FUNCTION__ << "multi/initial" << initialGlyphs;
 
         int nGlyphs = initialGlyphs.numGlyphs;
         QFontEngine::ShaperFlags shaperFlags(QFontEngine::GlyphIndicesOnly);
@@ -1032,6 +1035,8 @@ void QTextEngine::shapeText(int item) const
         itemBoundaries.append(0);
         itemBoundaries.append(0);
     }
+    qDebug() << __FUNCTION__ << "itemBoundaries" << itemBoundaries;
+
 
     bool kerningEnabled;
     bool letterSpacingIsAbsolute;
@@ -1071,6 +1076,7 @@ void QTextEngine::shapeText(int item) const
     layoutData->used += si.num_glyphs;
 
     QGlyphLayout glyphs = shapedGlyphs(&si);
+    qDebug() << __FUNCTION__ << '>' << glyphs;
 
 #ifdef QT_ENABLE_HARFBUZZ_NG
     if (Q_LIKELY(qt_useHarfbuzzNG()))
@@ -1078,13 +1084,18 @@ void QTextEngine::shapeText(int item) const
 #endif
 
     if (letterSpacing != 0) {
+        qDebug() << __FUNCTION__ << "letterSpacing";
         for (int i = 1; i < si.num_glyphs; ++i) {
             if (glyphs.attributes[i].clusterStart) {
-                if (letterSpacingIsAbsolute)
+                if (letterSpacingIsAbsolute) {
+                    QFixed ov = glyphs.advances[i - 1];
                     glyphs.advances[i - 1] += letterSpacing;
-                else {
+                    qDebug() << __FUNCTION__ << "b1 i=" << i << ov << "->" << glyphs.advances[i - 1];
+                } else {
                     QFixed &advance = glyphs.advances[i - 1];
+                    QFixed ov = advance;
                     advance += (letterSpacing - 100) * advance / 100;
+                    qDebug() << __FUNCTION__ << "b2 i=" << i << ov << "->" << advance;
                 }
             }
         }
@@ -1096,6 +1107,7 @@ void QTextEngine::shapeText(int item) const
         }
     }
     if (wordSpacing != 0) {
+        qDebug() << __FUNCTION__ << "wordSpacing";
         for (int i = 0; i < si.num_glyphs; ++i) {
             if (glyphs.attributes[i].justification == Justification_Space
                 || glyphs.attributes[i].justification == Justification_Arabic_Space) {
@@ -1110,6 +1122,9 @@ void QTextEngine::shapeText(int item) const
 
     for (int i = 0; i < si.num_glyphs; ++i)
         si.width += glyphs.advances[i] * !glyphs.attributes[i].dontPrint;
+
+    qDebug() << __FUNCTION__ << '<' << glyphs;
+
 }
 
 #ifdef QT_ENABLE_HARFBUZZ_NG
@@ -1129,8 +1144,20 @@ static const char *s_shapersForOsxFreeType[] =
 };
 #endif
 
-int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *string, int itemLength, QFontEngine *fontEngine, const QVector<uint> &itemBoundaries, bool kerningEnabled) const
+
+QDebug operator<<(QDebug d, const hb_glyph_position_t &hp)
 {
+    d << "hb_glyph_position_t(" << "x_advance=" << hp.x_advance << ",y_advance=" << hp.y_advance
+      <<",x_offset=" << hp.x_offset << "y_offset=" << hp.y_offset << ')';
+    return d;
+}
+
+int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *string, int itemLength,
+                                         QFontEngine *fontEngine,
+                                         const QVector<uint> &itemBoundaries,
+                                         bool kerningEnabled) const
+{
+    qDebug() << __FUNCTION__ << si <<  "itemLength="<<  itemLength << "kerningEnabled=" << kerningEnabled;
     uint glyphs_shaped = 0;
 
     hb_buffer_t *buffer = hb_buffer_create();
@@ -1147,6 +1174,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
     // ### props.language = hb_language_get_default_for_script(props.script);
 
     for (int k = 0; k < itemBoundaries.size(); k += 3) {
+        qDebug() << __FUNCTION__ << "loop=" << k;
         const uint item_pos = itemBoundaries[k];
         const uint item_length = (k + 4 < itemBoundaries.size() ? itemBoundaries[k + 3] : itemLength) - item_pos;
         const uint engineIdx = itemBoundaries[k + 2];
@@ -1208,20 +1236,23 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
 
         // fetch the shaped glyphs and metrics
         QGlyphLayout g = availableGlyphs(&si).mid(glyphs_shaped, num_glyphs);
+        qDebug() << __FUNCTION__ << g;
         ushort *log_clusters = logClusters(&si) + item_pos;
 
         hb_glyph_info_t *infos = hb_buffer_get_glyph_infos(buffer, 0);
-        hb_glyph_position_t *positions = hb_buffer_get_glyph_positions(buffer, 0);
+        hb_glyph_position_t *positions = hb_buffer_get_glyph_positions(buffer, 0);        
         uint str_pos = 0;
         uint last_cluster = ~0u;
         uint last_glyph_pos = glyphs_shaped;
         for (uint i = 0; i < num_glyphs; ++i, ++infos, ++positions) {
+            qDebug() << __FUNCTION__ << "l2" << i << *positions;
             g.glyphs[i] = infos->codepoint;
 
             g.advances[i] = QFixed::fromFixed(positions->x_advance);
             g.offsets[i].x = QFixed::fromFixed(positions->x_offset);
             g.offsets[i].y = QFixed::fromFixed(positions->y_offset);
 
+
             uint cluster = infos->cluster;
             if (Q_LIKELY(last_cluster != cluster)) {
                 g.attributes[i].clusterStart = true;
@@ -2177,7 +2208,7 @@ void QTextEngine::justify(const QScriptLine &line)
 
     QVarLengthArray<QJustificationPoint> justificationPoints;
     int nPoints = 0;
-//     qDebug("justifying from %d len %d, firstItem=%d, nItems=%d (%s)", line.from, line_length, firstItem, nItems, layoutData->string.mid(line.from, line_length).toUtf8().constData());
+     qDebug("justifying from %d len %d, firstItem=%d, nItems=%d (%s)", line.from, line_length, firstItem, nItems, layoutData->string.mid(line.from, line_length).toUtf8().constData());
     QFixed minKashida = 0x100000;
 
     // we need to do all shaping before we go into the next loop, as we there
@@ -2222,7 +2253,7 @@ void QTextEngine::justify(const QScriptLine &line)
                 // fall through
             case Justification_Arabic_Space:
                 if (kashida_pos >= 0) {
-//                     qDebug("kashida position at %d in word", kashida_pos);
+                     qDebug("kashida position at %d in word", kashida_pos);
                     set(&justificationPoints[nPoints], kashida_type, g.mid(kashida_pos), fontEngine(si));
                     if (justificationPoints[nPoints].kashidaWidth > 0) {
                         minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth);
@@ -2268,8 +2299,8 @@ void QTextEngine::justify(const QScriptLine &line)
         return;
     }
 
-//     qDebug("doing justification: textWidth=%x, requested=%x, maxJustify=%d", line.textWidth.value(), line.width.value(), maxJustify);
-//     qDebug("     minKashida=%f, need=%f", minKashida.toReal(), need.toReal());
+     qDebug("doing justification: textWidth=%x, requested=%x, maxJustify=%d", line.textWidth.value(), line.width.value(), maxJustify);
+     qDebug("     minKashida=%f, need=%f", minKashida.toReal(), need.toReal());
 
     // distribute in priority order
     if (maxJustify >= Justification_Arabic_Normal) {
@@ -2298,7 +2329,7 @@ void QTextEngine::justify(const QScriptLine &line)
             if (justificationPoints[i].type == type)
                 ++n;
         }
-//          qDebug("number of points for justification type %d: %d", type, n);
+          qDebug("number of points for justification type %d: %d", type, n);
 
 
         if (!n)
@@ -2307,7 +2338,7 @@ void QTextEngine::justify(const QScriptLine &line)
         for (int i = 0; i < nPoints; ++i) {
             if (justificationPoints[i].type == type) {
                 QFixed add = need/n;
-//                  qDebug("adding %x to glyph %x", add.value(), justificationPoints[i].glyph->glyph);
+                qDebug("adding %x to glyph %x", add.value(), justificationPoints[i].glyph);
                 justificationPoints[i].glyph.justifications[0].space_18d6 = add.value();
                 need -= add;
                 --n;
@@ -2462,6 +2493,38 @@ void QGlyphLayout::grow(char *address, int totalGlyphs)
     *this = newLayout;
 }
 
+QDebug operator<<(QDebug d, const QScriptItem &i)
+{
+    d << "QScriptItem(" << "position=" << i.position << "num_glyphs=" << i.num_glyphs << ",analysis=" << i.analysis.flags
+       << ",leading=" << i.leading << ",width=" << i.width
+      << ",ascent=" << i.ascent << ",descent=" << i.descent << ",height=" << i.height();
+    return d;
+}
+
+QDebug operator<<(QDebug d, const QGlyphJustification &j)
+{
+    d << "QGlyphJustification(" << j.type << ",nKashidas=" << j.nKashidas << ",space_18d6=" << j.space_18d6 << ')';
+    return d;
+}
+
+QDebug operator<<(QDebug d, const QFixedPoint &p)
+{
+    d << p.x << ',' << p.y;
+    return d;
+}
+
+QDebug operator<<(QDebug d, const QGlyphLayout &l)
+{
+
+    d << "QGlyphLayout(" << l.numGlyphs << ":\n";
+    for (int i = 0; i < l.numGlyphs; ++i) {
+        d << i << "glyph=" << l.glyphs[i] << " offset=" << l.offsets[i]
+             << "advance=" << l.advances[i] << l.justifications[i] << '\n';
+    }
+    d << ')';
+    return d;
+}
+
 void QTextEngine::freeMemory()
 {
     if (!stackEngine) {
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index dbe8e1e..0ff08be 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -73,7 +73,6 @@ QT_BEGIN_NAMESPACE
 
 class QFontPrivate;
 class QFontEngine;
-
 class QString;
 class QPainter;
 
@@ -165,6 +164,9 @@ struct QGlyphJustification
     uint nKashidas : 6; // more do not make sense...
     uint space_18d6 : 24;
 };
+
+QDebug operator<<(QDebug d, const QGlyphJustification &j);
+
 Q_DECLARE_TYPEINFO(QGlyphJustification, Q_PRIMITIVE_TYPE);
 
 struct QGlyphAttributes {
@@ -221,8 +223,15 @@ struct QGlyphLayout
         return copy;
     }
 
-    inline QFixed effectiveAdvance(int item) const
-    { return (advances[item] + QFixed::fromFixed(justifications[item].space_18d6)) * !attributes[item].dontPrint; }
+    QFixed effectiveAdvance(int item) const
+    {
+        QFixed a = advances[item];
+        QFixed j = QFixed::fromFixed(justifications[item].space_18d6);
+        QFixed r= (a + j) * !attributes[item].dontPrint;
+        qDebug() << __FUNCTION__ << "item=" << item << "adv=" << a << "just=" << j << "rets" << r;
+
+        return r;
+    }
 
     inline void clear(int first = 0, int last = -1) {
         if (last == -1)
@@ -244,9 +253,11 @@ struct QGlyphLayout
         return reinterpret_cast<char *>(offsets);
     }
 
-    void grow(char *address, int totalGlyphs);
+    void grow(char *address, int totalGlyphs);    
 };
 
+QDebug operator<<(QDebug d, const QGlyphLayout &l);
+
 class QVarLengthGlyphLayoutArray : private QVarLengthArray<void *>, public QGlyphLayout
 {
 private:
@@ -338,6 +349,7 @@ struct Q_AUTOTEST_EXPORT QScriptItem
     QFixed height() const { return ascent + descent; }
 };
 
+QDebug operator<<(QDebug, const QScriptItem &i);
 
 Q_DECLARE_TYPEINFO(QScriptItem, Q_MOVABLE_TYPE);
 
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index d68a59f..7da332c 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2419,6 +2419,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
 #endif
     const QScriptLine &line = eng->lines[index];
     QPen pen = p->pen();
+    qDebug() << '>' << __FUNCTION__ << "length=" << line.length;
 
     bool noText = (selection && selection->format.property(SuppressText).toBool());
 
@@ -2604,6 +2605,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
 
     if (eng->hasFormats())
         p->setPen(pen);
+    qDebug() << '<' << __FUNCTION__ ;
 }
 
 /*!
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index 3685197..b66fa28 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -317,6 +317,10 @@ QWindowsFontEngine::QWindowsFontEngine(const QString &name,
     setUserData(userData);
 
     hasUnreliableOutline = hasGlyfTable() && hasEbdtTable();
+    qDebug() << __FUNCTION__ << name << "x_height=" << x_height
+    << "pixelSize=" << fontDef.pixelSize <<
+       "fixedPitch=" <<   fontDef.fixedPitch ;
+
 }
 
 QWindowsFontEngine::~QWindowsFontEngine()
@@ -398,13 +402,16 @@ inline void calculateTTFGlyphWidth(HDC hdc, UINT glyph, int &width)
     if (ptrGetCharWidthI)
         ptrGetCharWidthI(hdc, glyph, 1, 0, &width);
 #endif
+    qDebug() << __FUNCTION__ << "glyph" << glyph << "->" << width;
 }
 
 void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const
 {
+    qDebug() << __FUNCTION__ << "flags" << flags;
     HGDIOBJ oldFont = 0;
     HDC hdc = m_fontEngineData->hdc;
     if (ttf && (flags & DesignMetrics)) {
+        qDebug() << __FUNCTION__ << "ttf/DesignMetrics";
         for(int i = 0; i < glyphs->numGlyphs; i++) {
             unsigned int glyph = glyphs->glyphs[i];
             if(int(glyph) >= designAdvancesSize) {
@@ -423,11 +430,13 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shape
                 calculateTTFGlyphWidth(hdc, glyph, width);
                 designAdvances[glyph] = QFixed(width) / designToDevice;
             }
+            qDebug() << __FUNCTION__ << "l1 i=" << i << "designAdvances=" << designAdvances[glyph];
             glyphs->advances[i] = designAdvances[glyph];
         }
         if(oldFont)
             DeleteObject(SelectObject(hdc, oldFont));
     } else {
+        qDebug() << __FUNCTION__ << "NON ttf/DesignMetrics";
         for(int i = 0; i < glyphs->numGlyphs; i++) {
             unsigned int glyph = glyphs->glyphs[i];
 
@@ -438,6 +447,7 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shape
                 memset(widthCache + widthCacheSize, 0, newSize - widthCacheSize);
                 widthCacheSize = newSize;
             }
+            qDebug() << __FUNCTION__ << "l2a i=" << i << "widthCache[glyph]=" << widthCache[glyph];
             glyphs->advances[i] = widthCache[glyph];
             // font-width cache failed
             if (glyphs->advances[i].value() == 0) {
@@ -455,14 +465,18 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shape
                     }
                     SIZE size = {0, 0};
                     GetTextExtentPoint32(hdc, (wchar_t *)ch, chrLen, &size);
+                    qDebug() << " size.cx=" <<  size.cx << "from GetTextExtentPoint32" << hdc << ch;
                     width = size.cx;
                 } else {
                     calculateTTFGlyphWidth(hdc, glyph, width);
                 }
+                qDebug() << __FUNCTION__ << "l2b i=" << i << "width=" << width;
                 glyphs->advances[i] = width;
                 // if glyph's within cache range, store it for later
-                if (width > 0 && width < 0x100)
+                if (width > 0 && width < 0x100) {
+                    qDebug() << __FUNCTION__ << "Storing cache" << width << "for"  << glyph;
                     widthCache[glyph] = width;
+                }
             }
         }
 
@@ -588,16 +602,20 @@ glyph_metrics_t QWindowsFontEngine::boundingBox(glyph_t glyph, const QTransform
 
 QFixed QWindowsFontEngine::ascent() const
 {
+    qDebug() << __FUNCTION__ << tm.tmAscent << _name  << "height" << m_logfont.lfHeight;
     return tm.tmAscent;
+
 }
 
 QFixed QWindowsFontEngine::descent() const
 {
+    qDebug() << __FUNCTION__ << tm.tmDescent << _name  << "height" << m_logfont.lfHeight;
     return tm.tmDescent;
 }
 
 QFixed QWindowsFontEngine::leading() const
 {
+    qDebug() << __FUNCTION__ << tm.tmExternalLeading << _name  << "height" << m_logfont.lfHeight;
     return tm.tmExternalLeading;
 }
 
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index f02f98c..f7cd5ef 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -403,6 +403,7 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
 void QStyledItemDelegate::paint(QPainter *painter,
         const QStyleOptionViewItem &option, const QModelIndex &index) const
 {
+    qDebug() << '>' << __FUNCTION__ << index.data();
     Q_ASSERT(index.isValid());
 
     QStyleOptionViewItem opt = option;
@@ -411,6 +412,7 @@ void QStyledItemDelegate::paint(QPainter *painter,
     const QWidget *widget = QStyledItemDelegatePrivate::widget(option);
     QStyle *style = widget ? widget->style() : QApplication::style();
     style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget);
+    qDebug() << '<' << __FUNCTION__ << index.data();
 }
 
 /*!
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index a4ecfc5..a7b82ce 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -916,10 +916,13 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt
         if (i == elidedIndex) {
             qreal x = position.x() + line.x();
             qreal y = position.y() + line.y() + line.ascent();
+            qDebug() << __FUNCTION__ << ">pos=" << position << "line" << line.x() << line.y()
+                     << "asc=" << line.ascent() << elidedText  << option->font;
             p->save();
             p->setFont(option->font);
             p->drawText(QPointF(x, y), elidedText);
             p->restore();
+            qDebug() <<__FUNCTION__ << '<';
             break;
         }
         line.draw(p, position);
@@ -2198,7 +2201,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
                     p->setPen(vopt->palette.color(cg, QPalette::Text));
                     p->drawRect(textRect.adjusted(0, 0, -1, -1));
                 }
-
+                qDebug() << __FUNCTION__ << p->font() <<vopt->text;
                 d->viewItemDrawText(p, vopt, textRect);
             }
 
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 7776773..1be156a 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -2528,6 +2528,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
     }
 
     XPThemeData theme(widget, p, themeNumber, partId, stateId, rect);
+    qDebug() << __FUNCTION__ << element << "valid t=" << theme.isValid();
     if (!theme.isValid()) {
         QWindowsStyle::drawControl(element, option, p, widget);
         return;
