[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 07:05:28 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 7d0b05a1d788d534ce8b08eab04dd05100998cd7
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 21 02:20:43 2002 +0000
Fixed 3107007. Letter-spacing is causing width to be miscalculated.
This also fixed some selection problems.
* khtml/rendering/font.cpp:
(Font::width):
Fixed 3107007. Letter-spacing is causing width to be miscalculated.
This also fixed some selection problems.
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/khtml/rendering/font.cpp b/WebCore/khtml/rendering/font.cpp
index fd5ea63..84aa396 100644
--- a/WebCore/khtml/rendering/font.cpp
+++ b/WebCore/khtml/rendering/font.cpp
@@ -118,7 +118,10 @@ void Font::floatCharacterWidths( QChar *str, int slen, int pos, int len, int toA
int Font::width( QChar *chs, int slen, int pos, int len ) const
{
#if APPLE_CHANGES
- return fm.width(chs + pos, len);
+#ifndef ROUND_TO_INT
+#define ROUND_TO_INT(x) (unsigned int)((x)+.5)
+#endif
+ return ROUND_TO_INT(fm.floatWidth(chs, slen, pos, len, letterSpacing, wordSpacing));
#else
QString qstr = QConstString(chs+pos, len).string();
// hack for fonts that don't have a welldefined nbsp
@@ -151,7 +154,7 @@ int Font::width( QChar *chs, int slen, int pos, int len ) const
int Font::width( QChar *chs, int slen, int pos ) const
{
#if APPLE_CHANGES
- return width(chs, slen, pos, 1);
+ return ROUND_TO_INT(fm.floatWidth(chs, slen, pos, 1, letterSpacing, wordSpacing));
#else
int w;
if ( !fontDef.hasNbsp && (chs+pos)->unicode() == 0xa0 )
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5e35b8e..dac6ce6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,13 @@
2002-11-20 Richard Williamson <rjw at apple.com>
+ Fixed 3107007. Letter-spacing is causing width to be miscalculated.
+ This also fixed some selection problems.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]):
+
+2002-11-20 Richard Williamson <rjw at apple.com>
+
Fixed mono spaced fonts to always render with mono spacing! (3078065)
* WebCoreSupport.subproj/WebTextRenderer.h:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 5e35b8e..dac6ce6 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,13 @@
2002-11-20 Richard Williamson <rjw at apple.com>
+ Fixed 3107007. Letter-spacing is causing width to be miscalculated.
+ This also fixed some selection problems.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:letterSpacing:wordSpacing:]):
+
+2002-11-20 Richard Williamson <rjw at apple.com>
+
Fixed mono spaced fonts to always render with mono spacing! (3078065)
* WebCoreSupport.subproj/WebTextRenderer.h:
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index fc80e5d..fe5f303 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -870,8 +870,9 @@ static const char *joiningNames[] = {
#ifdef DEBUG_COMBINING
printf ("Character 0x%04x, joining attribute %d(%s), combining class %d, direction %d(%s)\n", c, WebCoreUnicodeJoiningFunction(c), joiningNames[WebCoreUnicodeJoiningFunction(c)], WebCoreUnicodeCombiningClassFunction(c), WebCoreUnicodeDirectionFunction(c), directionNames[WebCoreUnicodeDirectionFunction(c)]);
#endif
-
- totalWidth += lastWidth;
+
+ if (i >= (unsigned int)pos)
+ totalWidth += lastWidth;
}
// Ceil the last glyph, but only if
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list