diff -r 4f2f89ce4247 -r 303757a437d3 WebCore/html/canvas/CanvasRenderingContext2D.cpp --- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp Fri Sep 17 09:02:29 2010 +0300 +++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp Mon Oct 04 01:32:07 2010 +0300 @@ -1632,7 +1632,19 @@ PassRefPtr CanvasRenderingContext2D::measureText(const String& text) { RefPtr metrics = TextMetrics::create(); + +#if PLATFORM(QT) + // We always use complex text shaping since it can't be turned off for QPainterPath::addText(). + Font::CodePath oldCodePath = Font::codePath(); + Font::setCodePath(Font::Complex); +#endif + metrics->setWidth(accessFont().width(TextRun(text.characters(), text.length()))); + +#if PLATFORM(QT) + Font::setCodePath(oldCodePath); +#endif + return metrics; } @@ -1743,7 +1755,18 @@ #endif c->setTextDrawingMode(fill ? cTextFill : cTextStroke); + +#if PLATFORM(QT) + // We always use complex text shaping since it can't be turned off for QPainterPath::addText(). + Font::CodePath oldCodePath = Font::codePath(); + Font::setCodePath(Font::Complex); +#endif + c->drawBidiText(font, textRun, location); + +#if PLATFORM(QT) + Font::setCodePath(oldCodePath); +#endif } const Font& CanvasRenderingContext2D::accessFont()