Changeset 52889 in webkit
- Timestamp:
- Jan 6, 2010, 5:41:32 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r52888 r52889 1 2010-01-06 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 <rdar://problem/7488126> With text-rendering: optimizelegibility, sometimes lines run too long 6 https://bugs.webkit.org/show_bug.cgi?id=32794 7 8 * platform/mac/fast/text/line-breaking-with-kerning-expected.checksum: Added. 9 * platform/mac/fast/text/line-breaking-with-kerning-expected.png: Added. 10 * platform/mac/fast/text/line-breaking-with-kerning-expected.txt: Added. 11 * platform/mac/fast/text/line-breaking-with-kerning.html: Added. 12 1 13 2010-01-06 Eric Seidel <eric@webkit.org> 2 14 -
trunk/WebCore/ChangeLog
r52885 r52889 1 2010-01-06 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 <rdar://problem/7488126> With text-rendering: optimizelegibility, sometimes lines run too long 6 https://bugs.webkit.org/show_bug.cgi?id=32794 7 8 Test: platform/mac/fast/text/line-breaking-with-kerning.html 9 10 * rendering/RenderBlockLineLayout.cpp: 11 (WebCore::RenderBlock::findNextLineBreak): When kerning is enabled, include 12 the trailing space when measuring a word, then subtract its width. This 13 accounts for kerning between the last glyph of the word and the following space. 14 1 15 2010-01-06 Kevin Decker <kdecker@apple.com> 2 16 -
trunk/WebCore/rendering/RenderBlockLineLayout.cpp
r52839 r52889 1805 1805 int lastSpaceWordSpacing = 0; 1806 1806 1807 TextRenderingMode textRenderingMode = f.fontDescription().textRenderingMode(); 1808 // Non-zero only when kerning is enabled, in which case we measure words with their trailing 1809 // space, then subtract its width. 1810 int wordTrailingSpaceWidth = textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? f.spaceWidth() + wordSpacing : 0; 1811 1807 1812 int wrapW = tmpW + inlineWidth(o, !appliedStartWidth, true); 1808 1813 int charWidth = 0; … … 1899 1904 } 1900 1905 1901 int additionalTmpW = textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing; 1906 int additionalTmpW; 1907 if (wordTrailingSpaceWidth && currentCharacterIsSpace) 1908 additionalTmpW = textWidth(t, lastSpace, pos + 1 - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) - wordTrailingSpaceWidth + lastSpaceWordSpacing; 1909 else 1910 additionalTmpW = textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing; 1902 1911 tmpW += additionalTmpW; 1903 1912 if (!appliedStartWidth) {
Note:
See TracChangeset
for help on using the changeset viewer.