[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:57:25 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 59ca4d0320edf8f71c03435991b9a50aaf6b56c0
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 6 01:47:57 2002 +0000

            Fixed a couple of issues that Dave highlighted w/ his whitespace
            fixes.  CG sometimes introduces very small 'error' in metrics, specifically
            we saw character widths of 20.0000019 that should have been 20.  As a
            work-around we loose precision beyond the 1000th place.  Also, always
            ceil spaces.
    
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 25a8163..7552db8 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,14 @@
+2002-11-05  Richard Williamson  <rjw at apple.com>
+
+        Fixed a couple of issues that Dave highlighted w/ his whitespace
+        fixes.  CG sometimes introduces very small 'error' in metrics, specifically
+        we saw character widths of 20.0000019 that should have been 20.  As a 
+        work-around we loose precision beyond the 1000th place.  Also, always
+        ceil spaces.
+                
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 25a8163..7552db8 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,14 @@
+2002-11-05  Richard Williamson  <rjw at apple.com>
+
+        Fixed a couple of issues that Dave highlighted w/ his whitespace
+        fixes.  CG sometimes introduces very small 'error' in metrics, specifically
+        we saw character widths of 20.0000019 that should have been 20.  As a 
+        work-around we loose precision beyond the 1000th place.  Also, always
+        ceil spaces.
+                
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3084704 -- crash in HTMLTokenizer on page with JavaScript
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index cda5d8e..256bbd1 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -27,7 +27,10 @@
 #define IS_CONTROL_CHARACTER(c) ((c) < 0x0020 || (c) == 0x007F)
 
 #define ROUND_TO_INT(x) (unsigned int)((x)+.5)
-#define CEIL_TO_INT(x) ((int)(x + (1.0 - FLT_EPSILON)))
+
+// Loose precision beyond 1000ths place.  This is a work-around to CG adding
+// small errors to some metrics.
+#define CEIL_TO_INT(x) ((int)((((int)(x*1000.0))/(1000.0)) + (1.0 - FLT_EPSILON)))
 
 #define LOCAL_BUFFER_SIZE 1024
 
@@ -462,11 +465,15 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
     if (rtl){
         UniChar *shaped;
         int lengthOut;
-        characters = shapedString ((UniChar *)&characters[from], length, from, to, 1, &lengthOut);
+        shaped = shapedString ((UniChar *)&characters[from], length,
+                               (from == -1 ? 0 : from),
+                               (to == -1 ? (int)length : to),
+                               1, &lengthOut);
         printf ("%d input, %d output\n", length, lengthOut);
         for (i = 0; i < (int)length; i++){
             printf ("0x%04x shaped to 0x%04x\n", characters[i], shaped[i]);
         }
+        characters = shaped;
     }
 #endif
 
@@ -481,7 +488,7 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         fonts: fontBuffer
         glyphs: glyphBuffer
         numGlyphs: &numGlyphs];
-    
+
     if (from == -1)
         from = 0;
     if (to == -1)
@@ -749,7 +756,7 @@ static const char *joiningNames[] = {
                     if (widthBuffer)
                         widthBuffer[numGlyphs - 1] += delta;
                 }   
-                lastWidth = ROUND_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphID));
+                lastWidth = CEIL_TO_INT(widthForGlyph(self, glyphToWidthMap, glyphID));
                 if (padding > 0){
                     // Only use left over padding if note evenly divisible by 
                     // number of spaces.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list