WebCore/html/canvas/CanvasRenderingContext2D.cpp
changeset 2 303757a437d3
parent 0 4f2f89ce4247
--- 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<TextMetrics> CanvasRenderingContext2D::measureText(const String& text)
 {
     RefPtr<TextMetrics> 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()