Implement new TextMetrics, returned by canvas measureText()
[WebKit-https.git] / Source / WebCore / platform / graphics / cairo / FontCairoHarfbuzzNG.cpp
index cc37d7d5814183f8a1ac6d85499ccb466a0485ba..e5a74f7f91fe11919980c762b0f063085f654808 100644 (file)
@@ -62,8 +62,15 @@ bool FontCascade::canExpandAroundIdeographsInComplexText()
     return false;
 }
 
-float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>*, GlyphOverflow*) const
+float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const Font*>*, GlyphOverflow* glyphOverflow) const
 {
+    if (glyphOverflow) {
+        // FIXME: Calculate the actual values rather than just the font's ascent and descent
+        glyphOverflow->top = glyphOverflow->computeBounds ? fontMetrics().ascent() : 0;
+        glyphOverflow->bottom = glyphOverflow->computeBounds ? fontMetrics().descent() : 0;
+        glyphOverflow->left = 0;
+        glyphOverflow->right = 0;
+    }
     HarfBuzzShaper shaper(this, run);
     if (shaper.shape())
         return shaper.totalWidth();