REOPENED 138762
Use underlining metrics from the font file
https://bugs.webkit.org/show_bug.cgi?id=138762
Summary Use underlining metrics from the font file
Myles C. Maxfield
Reported 2014-11-14 17:02:22 PST
Use underlining metrics from the font file
Attachments
Patch (17.89 KB, patch)
2014-11-14 17:09 PST, Myles C. Maxfield
no flags
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (539.69 KB, application/zip)
2014-11-14 18:18 PST, Build Bot
no flags
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion (558.96 KB, application/zip)
2014-11-14 19:10 PST, Build Bot
no flags
Patch (22.73 KB, patch)
2014-11-17 10:22 PST, Myles C. Maxfield
hyatt: review+
mmaxfield: commit-queue-
Patch (23.74 KB, patch)
2014-11-17 18:15 PST, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2014-11-14 17:09:32 PST
WebKit Commit Bot
Comment 2 2014-11-14 17:13:16 PST
Attachment 241645 [details] did not pass style-queue: ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jon Lee
Comment 3 2014-11-14 17:58:21 PST
Comment on attachment 241645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241645&action=review > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:69 > + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); This calculation reoccurs per port. Can we consolidate this?
Build Bot
Comment 4 2014-11-14 18:18:44 PST
Comment on attachment 241645 [details] Patch Attachment 241645 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4829837717929984 New failing tests: fast/css3-text/css3-text-decoration/text-decoration-thickness.html
Build Bot
Comment 5 2014-11-14 18:18:48 PST
Created attachment 241651 [details] Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-14 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 6 2014-11-14 19:10:41 PST
Comment on attachment 241645 [details] Patch Attachment 241645 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6706599913586688 New failing tests: fast/css3-text/css3-text-decoration/text-decoration-thickness.html
Build Bot
Comment 7 2014-11-14 19:10:46 PST
Created attachment 241655 [details] Archive of layout-test-results from webkit-ews-01 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-01 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Myles C. Maxfield
Comment 8 2014-11-17 09:54:42 PST
Comment on attachment 241645 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241645&action=review >> Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:69 >> + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); > > This calculation reoccurs per port. Can we consolidate this? I actually can't because the font size is considered platform-dependent (and the size is an input to these calculations). "Font"s have sizes because of the font-size CSS property, and "PlatformFontData"s have sizes because it's dealing with the platform directly, but SimpleFontData (nor its constituent FontMetrics) knows anything about sizes.
Myles C. Maxfield
Comment 9 2014-11-17 10:22:57 PST
Dave Hyatt
Comment 10 2014-11-17 14:26:12 PST
Comment on attachment 241722 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241722&action=review r=me > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:69 > + float decorationThickness = m_platformData.m_size / 16.0f; > + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); Comments might be nice here explaining what you're doing. > Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm:109 > + decorationThickness = m_platformData.size() / 16.0f; > + underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); Ditto. > Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp:73 > + float decorationThickness = m_platformData.size() / 16.0f; > + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); And again! > Source/WebCore/svg/SVGFontData.cpp:83 > + float decorationThickness = fontSize / 16.0f; > + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); This is coming up enough that maybe you want a helper somewhere that takes two float references and sets their values. That way if we ever decide to change behavior, you'd only have to patch one spot. :)
Myles C. Maxfield
Comment 11 2014-11-17 17:10:05 PST
Comment on attachment 241722 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241722&action=review >> Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:69 >> + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); > > Comments might be nice here explaining what you're doing. Done. >> Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm:109 >> + underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); > > Ditto. Done. >> Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp:73 >> + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); > > And again! Done. >> Source/WebCore/svg/SVGFontData.cpp:83 >> + float underlinePosition = std::max(1.0f, ceilf(decorationThickness / 2.0)); > > This is coming up enough that maybe you want a helper somewhere that takes two float references and sets their values. That way if we ever decide to change behavior, you'd only have to patch one spot. :) Done.
Myles C. Maxfield
Comment 12 2014-11-17 18:15:47 PST
Jon Lee
Comment 13 2014-11-18 08:06:54 PST
Myles C. Maxfield
Comment 14 2014-11-18 10:05:39 PST
WebKit Commit Bot
Comment 15 2014-11-18 17:15:30 PST
Re-opened since this is blocked by bug 138854
Sam Weinig
Comment 16 2014-11-28 23:07:27 PST
It seems the patch was rolled out due to "underlines looking hideous". What exactly was hideous about them? Do we want to abandon the idea of getting the metrics from fonts altogether (and close this bug), or does the patch just need fixing?
Myles C. Maxfield
Comment 17 2014-12-01 08:33:57 PST
This patch needs investigation. I think we are moving the underline after we place it according to the font file, moving it up too high, so it was intersecting each letter, causing the skipping logic to be triggered, meaning underlines turned into periods between each glyph
Note You need to log in before you can comment on or make changes to this bug.