[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:17:46 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 14969d5b39ce0d585ae09169766f93a55268879e
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jun 10 10:23:06 2002 +0000
90% solution to round-off problem. khtml breaks measures text on space
boundaries during layout. It assumes integer measurement, CG uses float
measurements. Some common fonts have non-integer space width. So,
differences in between drawing advances and measurement of space characters
can easily accumulate enough to be visually apparent. We may still accumulate
differences across words, although it's much less visible than for spaces.
As a next step we can fudge the advances of words to force
integer widths, although I think, given how khtml work, just accounting for
consistency in measuring and drawing spaces may be sufficient.
Many sites that looked flaky before now render correctly.
* WebCoreSupport.subproj/IFTextRenderer.m:
(-[IFTextRenderer drawCharacters:length:atPoint:withColor:]):
Force rounding of advance for space characters.
(-[IFTextRenderer floatWidthForCharacters:length:]):
Force rounding of measurement for space characters.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 48318fa..530b5fb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,25 @@
+2002-06-10 Richard Williamson <rjw at apple.com>
+
+ 90% solution to round-off problem. khtml breaks measures text on space
+ boundaries during layout. It assumes integer measurement, CG uses float
+ measurements. Some common fonts have non-integer space width. So,
+ differences in between drawing advances and measurement of space characters
+ can easily accumulate enough to be visually apparent. We may still accumulate
+ differences across words, although it's much less visible than for spaces.
+ As a next step we can fudge the advances of words to force
+ integer widths, although I think, given how khtml work, just accounting for
+ consistency in measuring and drawing spaces may be sufficient.
+ Many sites that looked flaky before now render correctly.
+
+ * WebCoreSupport.subproj/IFTextRenderer.m:
+ (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]):
+
+ Force rounding of advance for space characters.
+
+ (-[IFTextRenderer floatWidthForCharacters:length:]):
+
+ Force rounding of measurement for space characters.
+
2002-06-09 John Sullivan <sullivan at apple.com>
WebKit part of fix for 2949646 (Can't drag & drop bookmarks
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 48318fa..530b5fb 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,25 @@
+2002-06-10 Richard Williamson <rjw at apple.com>
+
+ 90% solution to round-off problem. khtml breaks measures text on space
+ boundaries during layout. It assumes integer measurement, CG uses float
+ measurements. Some common fonts have non-integer space width. So,
+ differences in between drawing advances and measurement of space characters
+ can easily accumulate enough to be visually apparent. We may still accumulate
+ differences across words, although it's much less visible than for spaces.
+ As a next step we can fudge the advances of words to force
+ integer widths, although I think, given how khtml work, just accounting for
+ consistency in measuring and drawing spaces may be sufficient.
+ Many sites that looked flaky before now render correctly.
+
+ * WebCoreSupport.subproj/IFTextRenderer.m:
+ (-[IFTextRenderer drawCharacters:length:atPoint:withColor:]):
+
+ Force rounding of advance for space characters.
+
+ (-[IFTextRenderer floatWidthForCharacters:length:]):
+
+ Force rounding of measurement for space characters.
+
2002-06-09 John Sullivan <sullivan at apple.com>
WebKit part of fix for 2949646 (Can't drag & drop bookmarks
diff --git a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
index 6def991..4d8a3a9 100644
--- a/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/IFTextRenderer.m
@@ -425,7 +425,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
- (void)drawCharacters:(const UniChar *)characters length: (unsigned int)length atPoint:(NSPoint)point withColor:(NSColor *)color
{
uint i, numGlyphs;
- CGGlyph *glyphs, localGlyphBuffer[LOCAL_GLYPH_BUFFER_SIZE];
+ CGGlyph *glyphs, spaceGlyph = -1, localGlyphBuffer[LOCAL_GLYPH_BUFFER_SIZE];
#ifndef DRAW_WITHOUT_ADVANCES
CGSize *advances, localAdvanceBuffer[LOCAL_GLYPH_BUFFER_SIZE];
#endif
@@ -494,6 +494,9 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
}
}
+ if (c == SPACE)
+ spaceGlyph = glyphID;
+
glyphs[i] = glyphID;
}
@@ -506,7 +509,10 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
}
for (i = 0; i < numGlyphs; i++) {
- advances[i].width = widthForGlyph(self, glyphToWidthMap, glyphs[i]);
+ if (glyphs[i] == spaceGlyph)
+ advances[i].width = ROUND_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphs[i]));
+ else
+ advances[i].width = widthForGlyph(self, glyphToWidthMap, glyphs[i]);
advances[i].height = 0;
}
#endif
@@ -646,7 +652,10 @@ cleanup:
}
}
- totalWidth += widthForGlyph(self, glyphToWidthMap, glyphID);
+ if (c == SPACE)
+ totalWidth += ROUND_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphID));
+ else
+ totalWidth += widthForGlyph(self, glyphToWidthMap, glyphID);
}
return totalWidth;
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 6def991..4d8a3a9 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -425,7 +425,7 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
- (void)drawCharacters:(const UniChar *)characters length: (unsigned int)length atPoint:(NSPoint)point withColor:(NSColor *)color
{
uint i, numGlyphs;
- CGGlyph *glyphs, localGlyphBuffer[LOCAL_GLYPH_BUFFER_SIZE];
+ CGGlyph *glyphs, spaceGlyph = -1, localGlyphBuffer[LOCAL_GLYPH_BUFFER_SIZE];
#ifndef DRAW_WITHOUT_ADVANCES
CGSize *advances, localAdvanceBuffer[LOCAL_GLYPH_BUFFER_SIZE];
#endif
@@ -494,6 +494,9 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
}
}
+ if (c == SPACE)
+ spaceGlyph = glyphID;
+
glyphs[i] = glyphID;
}
@@ -506,7 +509,10 @@ static bool hasMissingGlyphs(ATSGlyphVector *glyphs)
}
for (i = 0; i < numGlyphs; i++) {
- advances[i].width = widthForGlyph(self, glyphToWidthMap, glyphs[i]);
+ if (glyphs[i] == spaceGlyph)
+ advances[i].width = ROUND_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphs[i]));
+ else
+ advances[i].width = widthForGlyph(self, glyphToWidthMap, glyphs[i]);
advances[i].height = 0;
}
#endif
@@ -646,7 +652,10 @@ cleanup:
}
}
- totalWidth += widthForGlyph(self, glyphToWidthMap, glyphID);
+ if (c == SPACE)
+ totalWidth += ROUND_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphID));
+ else
+ totalWidth += widthForGlyph(self, glyphToWidthMap, glyphID);
}
return totalWidth;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list