RESOLVED FIXED174813
[WinCairo] Implement Font::platformBoundsForGlyph
https://bugs.webkit.org/show_bug.cgi?id=174813
Summary [WinCairo] Implement Font::platformBoundsForGlyph
Fujii Hironori
Reported 2017-07-25 00:51:13 PDT
(Forked from Bug 82798) Font::platformBoundsForGlyph in Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp is not implemented yet. > FloatRect Font::platformBoundsForGlyph(Glyph glyph) const > { > if (m_platformData.useGDI()) > return boundsForGDIGlyph(glyph); > //FIXME: Implement this > return FloatRect(); > }
Attachments
Wrongly placed text-emphasis (fast/text/emphasis.html) (30.94 KB, image/png)
2017-07-26 19:21 PDT, Fujii Hironori
no flags
Patch (1.97 KB, patch)
2017-07-26 20:54 PDT, Fujii Hironori
no flags
Patch (2.04 KB, patch)
2017-07-30 17:57 PDT, Fujii Hironori
no flags
WinCairo port's result of fast/text/emphasis.html after this change (30.86 KB, image/png)
2017-07-31 22:49 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2017-07-26 19:21:35 PDT
Created attachment 316505 [details] Wrongly placed text-emphasis (fast/text/emphasis.html) text-emphasis should be placed at horizontally center of the character.
Fujii Hironori
Comment 2 2017-07-26 20:54:32 PDT
Alex Christensen
Comment 3 2017-07-28 08:30:00 PDT
Comment on attachment 316514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316514&action=review > Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp:114 > + SaveDC(dc); Would it be more efficient to use GetCurrentObject and GetGraphicsMode instead of saving the entire dc?
Fujii Hironori
Comment 4 2017-07-30 17:01:03 PDT
Thank you for the review. I'm reading the spec of cairo_win32_scaled_font_select_font and the source code. https://www.cairographics.org/manual/cairo-Win32-Fonts.html#cairo-win32-scaled-font-select-font cairo_win32_scaled_font_select_font changes not only current font, but also the graphics mode, the world transform and the map mode. And, the spec recommends to use SaveDC() and RestoreDC(). I think it's safer to use SaveDC() and RestoreDC(). I realized I should call cairo_win32_scaled_font_done_font. (even though, this function does nothing actually) I'll revise the patch.
Fujii Hironori
Comment 5 2017-07-30 17:57:55 PDT
Alex Christensen
Comment 6 2017-07-31 14:21:48 PDT
Comment on attachment 316753 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316753&action=review > Source/WebCore/ChangeLog:8 > + Test: fast/text/emphasis.html This usually indicates that you added a new test. Do you mean this test failed with WinCairo before and not after?
Fujii Hironori
Comment 7 2017-07-31 22:49:30 PDT
Created attachment 316834 [details] WinCairo port's result of fast/text/emphasis.html after this change Still fails after this change. Mostly because the expectation are created for AppleWin port. I think it's too early for WinCairo port to add expectations because WinCairo BuildBot is not ready for layout tests. OK, I'll create a test for this change.
Alex Christensen
Comment 8 2017-08-01 17:39:20 PDT
Comment on attachment 316753 [details] Patch Let's just land this.
WebKit Commit Bot
Comment 9 2017-08-01 18:08:52 PDT
Comment on attachment 316753 [details] Patch Clearing flags on attachment: 316753 Committed r220117: <http://trac.webkit.org/changeset/220117>
WebKit Commit Bot
Comment 10 2017-08-01 18:08:53 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2017-08-01 18:09:35 PDT
Note You need to log in before you can comment on or make changes to this bug.