Title: [227876] trunk/Source/WebCore
Revision
227876
Author
[email protected]
Date
2018-01-30 23:28:23 -0800 (Tue, 30 Jan 2018)

Log Message

[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
https://bugs.webkit.org/show_bug.cgi?id=182093

Patch by Fujii Hironori <[email protected]> on 2018-01-30
Reviewed by Alex Christensen.

WebKit draws texts doubly by shifting 1px for fonts without bold
fonts but bold font is desired. This synthetic bold method draws
fonts with embedded bitmap fonts look like double strike in HiDPI.

No new tests (Covered by the existing tests).

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::createGDIFont): Overwrite lfWeight if the desired weight
is bold and matched font weight is't bold and in WinCairo port.
Fix wrong indentation.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (227875 => 227876)


--- trunk/Source/WebCore/ChangeLog	2018-01-31 06:01:54 UTC (rev 227875)
+++ trunk/Source/WebCore/ChangeLog	2018-01-31 07:28:23 UTC (rev 227876)
@@ -1,3 +1,21 @@
+2018-01-30  Fujii Hironori  <[email protected]>
+
+        [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
+        https://bugs.webkit.org/show_bug.cgi?id=182093
+
+        Reviewed by Alex Christensen.
+
+        WebKit draws texts doubly by shifting 1px for fonts without bold
+        fonts but bold font is desired. This synthetic bold method draws
+        fonts with embedded bitmap fonts look like double strike in HiDPI.
+
+        No new tests (Covered by the existing tests).
+
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::createGDIFont): Overwrite lfWeight if the desired weight
+        is bold and matched font weight is't bold and in WinCairo port.
+        Fix wrong indentation.
+
 2018-01-30  Youenn Fablet  <[email protected]> and Oleksandr Skachkov  <[email protected]>
 
         FetchResponse should support ConsumeData callback on chunk data is received

Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (227875 => 227876)


--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2018-01-31 06:01:54 UTC (rev 227875)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp	2018-01-31 07:28:23 UTC (rev 227876)
@@ -511,9 +511,14 @@
     matchData.m_chosen.lfQuality = DEFAULT_QUALITY;
     matchData.m_chosen.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
 
-   if (desiredItalic && !matchData.m_chosen.lfItalic && synthesizeItalic)
-       matchData.m_chosen.lfItalic = 1;
+#if USE(CAIRO)
+    if (isGDIFontWeightBold(desiredWeight) && !isGDIFontWeightBold(matchData.m_chosen.lfWeight))
+        matchData.m_chosen.lfWeight = desiredWeight;
+#endif
 
+    if (desiredItalic && !matchData.m_chosen.lfItalic && synthesizeItalic)
+        matchData.m_chosen.lfItalic = 1;
+
     auto chosenFont = adoptGDIObject(::CreateFontIndirect(&matchData.m_chosen));
     if (!chosenFont)
         return nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to