WebKit Bugzilla
Attachment 372833 Details for
Bug 198909
: [WinCairo] incorrect font height for 'Google Sans Display' font
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198909-20190625194654.patch (text/plain), 4.91 KB, created by
Fujii Hironori
on 2019-06-25 03:46:55 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-25 03:46:55 PDT
Size:
4.91 KB
patch
obsolete
>Subversion Revision: 246727 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index be3669f837f0142b1964176d55a3801c779bb46b..594f858058705077103810f69a168a6225a7ecb5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-25 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [WinCairo] incorrect font height for 'Google Sans Display' font >+ https://bugs.webkit.org/show_bug.cgi?id=198909 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r191893 changed to use OS/2 typo metrics, but its calculation >+ wasn't correct. And, there is no reliable way to get OS/2 table by >+ using Windows API. Revert the part of r191893 change at the >+ moment. >+ >+ * platform/graphics/win/SimpleFontDataCairoWin.cpp: >+ (WebCore::Font::platformInit): >+ * platform/graphics/win/SimpleFontDataWin.cpp: >+ (WebCore::Font::initGDIFont): >+ Reverted the part of r191893 change, and added FIXME comments. >+ > 2019-06-23 Simon Fraser <simon.fraser@apple.com> > > [Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped >diff --git a/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp b/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >index 157f80b51f2b8a7eb08d08a39250c7a61c6aa1f8..5be35bf6b727baf2a18ca82d0a95fb3185d0d0ed 100644 >--- a/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >+++ b/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp >@@ -67,23 +67,13 @@ void Font::platformInit() > > cairo_win32_scaled_font_select_font(scaledFont, dc); > >- OUTLINETEXTMETRIC metrics; >- GetOutlineTextMetrics(dc, sizeof(metrics), &metrics); >- TEXTMETRIC& textMetrics = metrics.otmTextMetrics; >- float ascent, descent, lineGap; >- // The Open Font Format describes the OS/2 USE_TYPO_METRICS flag as follows: >- // "If set, it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font." >- const UINT useTypoMetricsMask = 1 << 7; >- if (metrics.otmfsSelection & useTypoMetricsMask) { >- ascent = metrics.otmAscent * metricsMultiplier; >- descent = metrics.otmDescent * metricsMultiplier; >- lineGap = metrics.otmLineGap * metricsMultiplier; >- } else { >- ascent = textMetrics.tmAscent * metricsMultiplier; >- descent = textMetrics.tmDescent * metricsMultiplier; >- lineGap = textMetrics.tmExternalLeading * metricsMultiplier; >- } >- float xHeight = ascent * 0.56f; // Best guess for xHeight for non-Truetype fonts. >+ // FIXME: Needs to take OS/2 USE_TYPO_METRICS flag into account >+ // https://bugs.webkit.org/show_bug.cgi?id=199186 >+ TEXTMETRIC textMetrics; >+ GetTextMetrics(dc, &textMetrics); >+ float ascent = textMetrics.tmAscent * metricsMultiplier; >+ float descent = textMetrics.tmDescent * metricsMultiplier; >+ float lineGap = textMetrics.tmExternalLeading * metricsMultiplier; > > m_fontMetrics.setAscent(ascent); > m_fontMetrics.setDescent(descent); >@@ -94,7 +84,7 @@ void Font::platformInit() > > cairo_text_extents_t extents; > cairo_scaled_font_text_extents(scaledFont, "x", &extents); >- xHeight = -extents.y_bearing; >+ float xHeight = -extents.y_bearing; > > m_fontMetrics.setXHeight(xHeight); > cairo_win32_scaled_font_done_font(scaledFont); >diff --git a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >index 143545f90bec869356e3fdc83a865876a948c78e..34571e0e85164ed84c58ccc21e605b78a169eb28 100644 >--- a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >+++ b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp >@@ -87,19 +87,11 @@ void Font::initGDIFont() > OUTLINETEXTMETRIC metrics; > GetOutlineTextMetrics(hdc, sizeof(metrics), &metrics); > TEXTMETRIC& textMetrics = metrics.otmTextMetrics; >- float ascent, descent, lineGap; >- // The Open Font Format describes the OS/2 USE_TYPO_METRICS flag as follows: >- // "If set, it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font." >- const UINT useTypoMetricsMask = 1 << 7; >- if (metrics.otmfsSelection & useTypoMetricsMask) { >- ascent = metrics.otmAscent; >- descent = metrics.otmDescent; >- lineGap = metrics.otmLineGap; >- } else { >- ascent = textMetrics.tmAscent; >- descent = textMetrics.tmDescent; >- lineGap = textMetrics.tmExternalLeading; >- } >+ // FIXME: Needs to take OS/2 USE_TYPO_METRICS flag into account >+ // https://bugs.webkit.org/show_bug.cgi?id=199186 >+ float ascent = textMetrics.tmAscent; >+ float descent = textMetrics.tmDescent; >+ float lineGap = textMetrics.tmExternalLeading; > m_fontMetrics.setAscent(ascent); > m_fontMetrics.setDescent(descent); > m_fontMetrics.setLineGap(lineGap);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198909
:
372231
|
372232
|
372233
|
372624
|
372821
|
372822
|
372823
|
372825
|
372828
|
372829
|
372831
| 372833