Changeset 76445 in webkit
- Timestamp:
- Jan 22, 2011 5:46:31 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r76444 r76445 1 2011-01-22 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 REGRESSION: Vertical line metrics incorrect 6 https://bugs.webkit.org/show_bug.cgi?id=52960 7 8 SimpleFontDataMac.mm contains a hack to modifiy lineGap/descent for the 'Hiragino' font. 9 That didn't influence the lineSpacing so far, but does now, causing regressions. 10 11 Restore old line spacing behaviour to fix the regression. 12 Covered by existing fast/blockflow, fast/repaint and fast/text/international test cases. 13 14 * platform/graphics/FontMetrics.h: 15 (WebCore::FontMetrics::FontMetrics): 16 (WebCore::FontMetrics::floatLineSpacing): 17 (WebCore::FontMetrics::setLineSpacing): 18 (WebCore::FontMetrics::lineSpacing): 19 (WebCore::FontMetrics::reset): 20 * platform/graphics/SimpleFontData.cpp: 21 (WebCore::SimpleFontData::SimpleFontData): 22 * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: 23 (WebCore::SimpleFontData::platformInit): 24 * platform/graphics/chromium/SimpleFontDataLinux.cpp: 25 (WebCore::SimpleFontData::platformInit): 26 * platform/graphics/freetype/SimpleFontDataFreeType.cpp: 27 (WebCore::SimpleFontData::platformInit): 28 * platform/graphics/haiku/SimpleFontDataHaiku.cpp: 29 (WebCore::SimpleFontData::platformInit): 30 * platform/graphics/mac/SimpleFontDataMac.mm: 31 (WebCore::SimpleFontData::platformInit): 32 * platform/graphics/pango/SimpleFontDataPango.cpp: 33 (WebCore::SimpleFontData::platformInit): 34 * platform/graphics/qt/SimpleFontDataQt.cpp: 35 (WebCore::SimpleFontData::platformInit): 36 * platform/graphics/win/SimpleFontDataCGWin.cpp: 37 (WebCore::SimpleFontData::platformInit): 38 * platform/graphics/win/SimpleFontDataCairoWin.cpp: 39 (WebCore::SimpleFontData::platformInit): 40 * platform/graphics/win/SimpleFontDataWin.cpp: 41 (WebCore::SimpleFontData::initGDIFont): 42 * platform/graphics/wince/SimpleFontDataWinCE.cpp: 43 (WebCore::SimpleFontData::platformInit): 44 * platform/graphics/wx/SimpleFontDataWx.cpp: 45 (WebCore::SimpleFontData::platformInit): 46 1 47 2011-01-22 Andreas Kling <kling@webkit.org> 2 48 -
trunk/Source/WebCore/platform/graphics/FontMetrics.h
r76442 r76445 34 34 , m_descent(0) 35 35 , m_lineGap(0) 36 , m_lineSpacing(0) 36 37 , m_xHeight(0) 37 38 { … … 67 68 void setLineGap(float lineGap) { m_lineGap = lineGap; } 68 69 69 float floatLineSpacing() const { return m_ascent + m_descent + m_lineGap; } 70 float floatLineSpacing() const { return m_lineSpacing; } 71 void setLineSpacing(float lineSpacing) { m_lineSpacing = lineSpacing; } 70 72 71 73 float xHeight() const { return m_xHeight; } … … 93 95 94 96 int lineGap() const { return lroundf(m_lineGap); } 95 96 int lineSpacing() const 97 { 98 // This mimics the old WebCore definition of lineSpacing. Changing to lroundf(m_ascent + m_descent + m_lineGap) causes lots of 1px height differences in the DRT dumps 99 return lroundf(m_ascent) + lroundf(m_descent) + lroundf(m_lineGap); 100 } 97 int lineSpacing() const { return lroundf(m_lineSpacing); } 101 98 102 99 private: … … 109 106 m_descent = 0; 110 107 m_lineGap = 0; 108 m_lineSpacing = 0; 111 109 m_xHeight = 0; 112 110 } … … 116 114 float m_descent; 117 115 float m_lineGap; 116 float m_lineSpacing; 118 117 float m_xHeight; 119 118 }; -
trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp
r76442 r76445 89 89 m_fontMetrics.setDescent(descent); 90 90 m_fontMetrics.setLineGap(lineGap); 91 m_fontMetrics.setLineSpacing(ascent + descent + lineGap); 91 92 m_fontMetrics.setXHeight(xHeight); 92 93 -
trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
r76442 r76445 98 98 m_fontMetrics.setLineGap(lineGap); 99 99 m_fontMetrics.setXHeight(xHeight); 100 m_fontMetrics.setLineSpacing(ascent + descent + lineGap); 100 101 101 102 SelectObject(dc, oldFont); -
trunk/Source/WebCore/platform/graphics/chromium/SimpleFontDataLinux.cpp
r76442 r76445 110 110 } 111 111 112 m_fontMetrics.setLineGap(SkScalarToFloat(metrics.fLeading)); 112 float lineGap = SkScalarToFloat(metrics.fLeading); 113 m_fontMetrics.setLineGap(lineGap); 113 114 m_fontMetrics.setXHeight(xHeight); 115 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); 114 116 115 117 if (m_orientation == Vertical) { -
trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
r76442 r76445 63 63 if (lineSpacing < font_extents.ascent + font_extents.descent) 64 64 lineSpacing = font_extents.ascent + font_extents.descent; 65 66 m_fontMetrics.setLineSpacing(lroundf(lineSpacing)); 65 67 m_fontMetrics.setLineGap(lineSpacing - font_extents.ascent - font_extents.descent); 66 68 -
trunk/Source/WebCore/platform/graphics/haiku/SimpleFontDataHaiku.cpp
r76442 r76445 53 53 m_fontMetrics.setXHeight(height.ascent * 0.56f); // Hack taken from the win port. 54 54 m_fontMetrics.setLineGap(height.leading); 55 m_fontMetrics.setLineSpacing(lroundf(height.ascent) + lroundf(height.descent) + lroundf(height.leading)); 55 56 } 56 57 -
trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
r76442 r76445 250 250 } 251 251 252 // Compute and store line spacing, before the line metrics hacks are applied. 253 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); 254 252 255 // Hack Hiragino line metrics to allow room for marked text underlines. 253 256 // <rdar://problem/5386183> -
trunk/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp
r76442 r76445 62 62 if (lineSpacing < font_extents.ascent + font_extents.descent) 63 63 lineSpacing = font_extents.ascent + font_extents.descent; 64 m_fontMetrics.setLineSpacing(lroundf(lineSpacing)); 64 65 m_fontMetrics.setLineGap(lineSpacing - font_extents.ascent - font_extents.descent); 65 66 -
trunk/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
r76442 r76445 53 53 m_fontMetrics.setXHeight(fm.xHeight()); 54 54 m_fontMetrics.setLineGap(fm.leading()); 55 m_fontMetrics.setLineSpacing(fm.lineSpacing()); 55 56 m_spaceWidth = fm.width(QLatin1Char(' ')); 56 57 } -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
r76442 r76445 97 97 m_fontMetrics.setDescent(fDescent); 98 98 m_fontMetrics.setLineGap(fLineGap); 99 m_fontMetrics.setLineSpacing(lroundf(fAscent) + lroundf(fDescent) + lroundf(fLineGap)); 99 100 100 101 // Measure the actual character "x", because AppKit synthesizes X height rather than getting it from the font. -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp
r76442 r76445 71 71 m_fontMetrics.setDescent(descent); 72 72 m_fontMetrics.setLineGap(lineGap); 73 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); 73 74 m_avgCharWidth = textMetrics.tmAveCharWidth * metricsMultiplier; 74 75 m_maxCharWidth = textMetrics.tmMaxCharWidth * metricsMultiplier; -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
r76442 r76445 84 84 m_fontMetrics.setDescent(descent); 85 85 m_fontMetrics.setLineGap(lineGap); 86 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); 86 87 m_avgCharWidth = textMetrics.tmAveCharWidth; 87 88 m_maxCharWidth = textMetrics.tmMaxCharWidth; -
trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
r76442 r76445 58 58 m_fontMetrics.setDescent(descent); 59 59 m_fontMetrics.setLineGap(lineGap); 60 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap)); 60 61 m_fontMetrics.setXHeight(ascent * 0.56f); 61 62 } -
trunk/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
r76442 r76445 59 59 m_fontMetrics.setUnitsPerEm(1); // FIXME! 60 60 m_fontMetrics.setLineGap(props.GetLineGap()); 61 m_fontMetrics.setLineSpacing(props.GetLineSpacing()); 61 62 } 62 63
Note: See TracChangeset
for help on using the changeset viewer.