Skip to content

Commit 61e50c8

Browse files
fujiiwebkit-commit-queue
authored andcommitted
[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 <Hironori.Fujii@sony.com> 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. Canonical link: https://commits.webkit.org/198126@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 403f0c3 commit 61e50c8

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

Source/WebCore/ChangeLog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2018-01-30 Fujii Hironori <Hironori.Fujii@sony.com>
2+
3+
[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
4+
https://bugs.webkit.org/show_bug.cgi?id=182093
5+
6+
Reviewed by Alex Christensen.
7+
8+
WebKit draws texts doubly by shifting 1px for fonts without bold
9+
fonts but bold font is desired. This synthetic bold method draws
10+
fonts with embedded bitmap fonts look like double strike in HiDPI.
11+
12+
No new tests (Covered by the existing tests).
13+
14+
* platform/graphics/win/FontCacheWin.cpp:
15+
(WebCore::createGDIFont): Overwrite lfWeight if the desired weight
16+
is bold and matched font weight is't bold and in WinCairo port.
17+
Fix wrong indentation.
18+
119
2018-01-30 Youenn Fablet <youenn@apple.com> and Oleksandr Skachkov <gskachkov@gmail.com>
220

321
FetchResponse should support ConsumeData callback on chunk data is received

Source/WebCore/platform/graphics/win/FontCacheWin.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,13 @@ static GDIObject<HFONT> createGDIFont(const AtomicString& family, LONG desiredWe
511511
matchData.m_chosen.lfQuality = DEFAULT_QUALITY;
512512
matchData.m_chosen.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
513513

514-
if (desiredItalic && !matchData.m_chosen.lfItalic && synthesizeItalic)
515-
matchData.m_chosen.lfItalic = 1;
514+
#if USE(CAIRO)
515+
if (isGDIFontWeightBold(desiredWeight) && !isGDIFontWeightBold(matchData.m_chosen.lfWeight))
516+
matchData.m_chosen.lfWeight = desiredWeight;
517+
#endif
518+
519+
if (desiredItalic && !matchData.m_chosen.lfItalic && synthesizeItalic)
520+
matchData.m_chosen.lfItalic = 1;
516521

517522
auto chosenFont = adoptGDIObject(::CreateFontIndirect(&matchData.m_chosen));
518523
if (!chosenFont)

0 commit comments

Comments
 (0)