Bug 67998
Summary: | [chromium] line gap is added twice in SimpleFontData::platformInit | ||
---|---|---|---|
Product: | WebKit | Reporter: | Robin Cao <robin.webkit> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | dglazkov, efidler, evan, jamesr, robin.webkit |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Linux |
Robin Cao
Line gap can be added twice in certain code path, which causes layout issues for fonts with large line gap values.
Please see SimpleFontData::platformInit() in Source/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Robin Cao
The patch will look like this:
--- a/Source/WebCore/platform/graphics/blackberry/skia/SimpleFontDataBlackBerry.cpp
+++ b/Source/WebCore/platform/graphics/blackberry/skia/SimpleFontDataBlackBerry.cpp
@@ -85,6 +85,10 @@ void SimpleFontData::platformInit()
SkScalar height = -metrics.fAscent + metrics.fDescent + metrics.fLeading;
m_fontMetrics.setAscent(SkScalarRound(-metrics.fAscent));
m_fontMetrics.setDescent(SkScalarRound(height) - m_fontMetrics.ascent());
+ // leading has been added to ascent/descent, so need to reset it to zero.
+ // Otherwise, it will be added twice, which causes layout issues for fonts
+ // with large leading values.
+ metrics.fLeading = 0;
}
if (metrics.fXHeight)
If this is the right way to go, i'll upload a patch later.
Robin Cao
CC authors...
Eli Fidler
This issue is extremely complicated, but the proposed method is incorrect. See https://bugs.webkit.org/show_bug.cgi?id=83279
*** This bug has been marked as a duplicate of bug 83279 ***