Bug 182093 - [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
Summary: [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
: 182205 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-25 02:33 PST by Fujii Hironori
Modified: 2018-01-30 23:43 PST (History)
8 users (show)

See Also:


Attachments
test case (594 bytes, text/html)
2018-01-25 02:33 PST, Fujii Hironori
no flags Details
screenshot (55.85 KB, image/png)
2018-01-25 02:34 PST, Fujii Hironori
no flags Details
WIP patch (683 bytes, patch)
2018-01-26 00:28 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
screenshot after this fix (86.42 KB, image/png)
2018-01-26 00:29 PST, Fujii Hironori
no flags Details
WIP patch (785 bytes, patch)
2018-01-29 23:37 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews202 for win-future (12.38 MB, application/zip)
2018-01-30 10:12 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews201 for win-future (12.31 MB, application/zip)
2018-01-30 12:25 PST, EWS Watchlist
no flags Details
Patch (2.21 KB, patch)
2018-01-30 20:31 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2018-01-25 02:33:21 PST
Created attachment 332240 [details]
test case

[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI

MS Gothic is a Japanese font with embedded bitmap fonts.
Meiryo is a Japanese font without embedded bitmap fonts.
Comment 1 Fujii Hironori 2018-01-25 02:34:54 PST
Created attachment 332242 [details]
screenshot
Comment 2 Fujii Hironori 2018-01-26 00:28:52 PST
Created attachment 332358 [details]
WIP patch
Comment 3 Fujii Hironori 2018-01-26 00:29:29 PST
Created attachment 332359 [details]
screenshot after this fix
Comment 4 Fujii Hironori 2018-01-28 17:56:54 PST
I've confirmed AppleWin port also has this problem.
Comment 5 Fujii Hironori 2018-01-29 02:04:02 PST
Font weight matching specifications:

Cascading Style Sheets Level 2 Revision 2 (CSS 2.2) Specification:
Font boldness: the 'font-weight' property
https://www.w3.org/TR/CSS22/fonts.html#font-boldness

CSS Fonts Module Level 3
the font-weight property
https://www.w3.org/TR/2013/CR-css-fonts-3-20131003/#font-weight-prop


Relevant bugs:

Bug 6484 – font-weight does not properly support graded weights

Bug 18311 – REGRESSION (r31620): Font variants (e.g. Helvetica Neue *Light*) don't render correctly

Bug 18307 – REGRESSION (r31620): Incorrect Hiragino Kaku Gothic, font-weight:500

Bug 34147 – If @font-face does not provide an explicit italic/bold variant, regular is used
Comment 6 Fujii Hironori 2018-01-29 23:37:26 PST
Created attachment 332632 [details]
WIP patch
Comment 7 Fujii Hironori 2018-01-30 00:00:31 PST
Hi Alex, Brent and Per Arne,

I believe this change improves not only WinCairo port, but also
AppleWin port. But, I can't set up LayoutTests env of AppleWin
port on my Windows 10 PC. So, I can't check the regression and
rebaseline expectations.

Should I use `#if USE(CAIRO)` to change only WinCairo port?

I have followed this instruction to set up LayoutTests
env. (https://trac.webkit.org/wiki/BuildingOnWindows) This makes
bunch of tests green. But, I still have some test failures due to
text dimension differences.
Comment 8 EWS Watchlist 2018-01-30 10:12:39 PST
Comment on attachment 332632 [details]
WIP patch

Attachment 332632 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/6262205

New failing tests:
fast/css/font-face-multiple-faces.html
fonts/monospace.html
fonts/cursive.html
fast/text/font-weights-zh.html
fonts/fantasy.html
fast/forms/select/optgroup-rendering.html
Comment 9 EWS Watchlist 2018-01-30 10:12:50 PST
Created attachment 332665 [details]
Archive of layout-test-results from ews202 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews202  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 10 EWS Watchlist 2018-01-30 12:25:24 PST
Comment on attachment 332632 [details]
WIP patch

Attachment 332632 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/6263618

New failing tests:
fast/css/font-face-multiple-faces.html
fonts/monospace.html
fonts/cursive.html
fast/text/font-weights-zh.html
fonts/fantasy.html
fast/forms/select/optgroup-rendering.html
Comment 11 EWS Watchlist 2018-01-30 12:25:35 PST
Created attachment 332682 [details]
Archive of layout-test-results from ews201 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews201  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 12 Alex Christensen 2018-01-30 16:32:38 PST
(In reply to Fujii Hironori from comment #7)
> Should I use `#if USE(CAIRO)` to change only WinCairo port?
Let's do that for now.  I'd rather not change text in the AppleWin port like this unless we find content that we want to intentionally change.
Comment 13 Fujii Hironori 2018-01-30 19:21:17 PST
(In reply to Alex Christensen from comment #12)

Thanks for your comment. I'll do so.
Comment 14 Fujii Hironori 2018-01-30 20:02:34 PST
Comment on attachment 332682 [details]
Archive of layout-test-results from ews201 for win-future

I checked all AppleWin port EWS LayoutTests failures.
They seem to be caused by the difference of synthetic bold methods of WebKit and Windows.
WebKit draws texts doubly by shifting 1px.
Windows creates bold fonts from a TrueType fonts.
Comment 15 Fujii Hironori 2018-01-30 20:31:51 PST
Created attachment 332740 [details]
Patch
Comment 16 WebKit Commit Bot 2018-01-30 23:28:27 PST
Comment on attachment 332740 [details]
Patch

Clearing flags on attachment: 332740

Committed r227876: <https://trac.webkit.org/changeset/227876>
Comment 17 WebKit Commit Bot 2018-01-30 23:28:29 PST
All reviewed patches have been landed.  Closing bug.
Comment 18 Radar WebKit Bug Importer 2018-01-30 23:31:01 PST
<rdar://problem/37059617>
Comment 19 Fujii Hironori 2018-01-30 23:43:30 PST
*** Bug 182205 has been marked as a duplicate of this bug. ***