+2017-08-01 Fujii Hironori <Hironori.Fujii@sony.com>
+
+ [WinCairo] Implement Font::platformBoundsForGlyph
+ https://bugs.webkit.org/show_bug.cgi?id=174813
+
+ Reviewed by Alex Christensen.
+
+ Test: fast/text/emphasis.html
+
+ * platform/graphics/win/SimpleFontDataCairoWin.cpp:
+ (WebCore::Font::platformBoundsForGlyph): Implemented by copying
+ the code from Font::boundsForGDIGlyph().
+
2017-08-01 Zalan Bujtas <zalan@apple.com>
REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
{
if (m_platformData.useGDI())
return boundsForGDIGlyph(glyph);
- //FIXME: Implement this
- return FloatRect();
+
+ HWndDC dc(0);
+ SaveDC(dc);
+ auto scaledFont = m_platformData.scaledFont();
+ cairo_win32_scaled_font_select_font(scaledFont, dc);
+
+ GLYPHMETRICS gdiMetrics;
+ static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 };
+ GetGlyphOutline(dc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity);
+
+ cairo_win32_scaled_font_done_font(scaledFont);
+ RestoreDC(dc, -1);
+ return FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y,
+ gdiMetrics.gmBlackBoxX + m_syntheticBoldOffset, gdiMetrics.gmBlackBoxY);
}
float Font::platformWidthForGlyph(Glyph glyph) const