[WinCairo] small MS Gothic font with -webkit-font-smoothing:antialiased is blurry r254506 (Bug 54763) added -webkit-font-smoothing support. Since then some texts in Google News of Japanese are rendered blurry. 1. Start WinCairo MiniBrowser 2. Go to https://news.google.com/?hl=ja&gl=JP&ceid=JP%3Aja
Created attachment 388403 [details] [Screenshot] Google News (Japan) of WinCairo port (150% display scale factor)
Created attachment 388406 [details] test case
Created attachment 388502 [details] [screenshot] GMail in WinCairo (with -webkit-font-smoothing support, r254899) I realized GMail also looks blurry even for alphabet.
Created attachment 388504 [details] [screenshot] GMail in WinCairo (without -webkit-font-smoothing support, r254326) Old WinCairo renders clearly.
I'm spoofing Safari User-Agent string to use GMail in WinCairo.
Created attachment 402626 [details] [screenshot] https://www.apple.com/ in WinCairo (with -webkit-font-smoothing support, r254899)
-webkit-font-smoothing:antialiased is mapped to CAIRO_ANTIALIAS_GRAY. And CAIRO_ANTIALIAS_GRAY is mapped to ANTIALIASED_QUALITY. If I changed to use DEFAULT_QUALITY instead of ANTIALIASED_QUALITY by applying the following patch to Cairo, the font looked good. diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c index 1f217573b..355192dc0 100644 --- a/src/win32/cairo-win32-font.c +++ b/src/win32/cairo-win32-font.c @@ -347,7 +347,7 @@ _win32_scaled_font_create (LOGFONTW *logfont, case CAIRO_ANTIALIAS_GRAY: case CAIRO_ANTIALIAS_FAST: case CAIRO_ANTIALIAS_GOOD: - f->quality = ANTIALIASED_QUALITY; + f->quality = DEFAULT_QUALITY; break; case CAIRO_ANTIALIAS_SUBPIXEL: case CAIRO_ANTIALIAS_BEST: This issue seems a Windows API issue.
Created attachment 402627 [details] Patch
Created attachment 402628 [details] [screenshot] https://www.apple.com/ in WinCairo with the proposed patch
Comment on attachment 402627 [details] Patch This seems fine.
Committed r263471: <https://trac.webkit.org/changeset/263471>
<rdar://problem/64716389>