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


The following commit has been merged in the debian/unstable branch:
commit d3c79674c86f0522a722d6ccdaabda525a383a3a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 7 01:21:07 2002 +0000

            More work on rendering scripts. Now most complex scripts render correctly.
            Working new features include:
            bidi, diacriticals, cursive forms, and arabic ligatures.
            Selection of text rendered in these scripts, is however, not working.
            Also, line height is incorrect when renderering combined below glyphs.
            ajami is, sadly, horrendously broken.
            * Misc.subproj/WebUnicode.m:
            (glyphVariantLogical):
            (shapedString):
            * WebCoreSupport.subproj/WebTextRenderer.m:
            (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]):
            (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
    
            Use our notion of unicode whitespace from lookup tables
            and isspace for latin1.  This is more correct than CF.
            Fixed issues Dave ran into with whitespace calculations.
    
            * kwq/KWQChar.mm:
            (QChar::isSpace):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2583 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index edf8709..9d71606 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,12 @@
+2002-11-06  Richard Williamson  <rjw at apple.com>
+
+        Use our notion of unicode whitespace from lookup tables
+        and isspace for latin1.  This is more correct than CF.
+        Fixed issues Dave ran into with whitespace calculations.
+        
+        * kwq/KWQChar.mm:
+        (QChar::isSpace):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3092722 -- assertion failed
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index edf8709..9d71606 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2002-11-06  Richard Williamson  <rjw at apple.com>
+
+        Use our notion of unicode whitespace from lookup tables
+        and isspace for latin1.  This is more correct than CF.
+        Fixed issues Dave ran into with whitespace calculations.
+        
+        * kwq/KWQChar.mm:
+        (QChar::isSpace):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3092722 -- assertion failed
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index edf8709..9d71606 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,12 @@
+2002-11-06  Richard Williamson  <rjw at apple.com>
+
+        Use our notion of unicode whitespace from lookup tables
+        and isspace for latin1.  This is more correct than CF.
+        Fixed issues Dave ran into with whitespace calculations.
+        
+        * kwq/KWQChar.mm:
+        (QChar::isSpace):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
 	- fixed 3092722 -- assertion failed
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index 4107054..3cae1e3 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -43,12 +43,12 @@ const QChar QChar::null;
 
 bool QChar::isSpace() const
 {
-    // Without this first quick case, this function was showing up in profiles.
+    // Use isspace() for basic latin1.  This will include newlines, which
+    // aren't included in unicode DirWS.
     if (c <= 0x7F) {
         return isspace(c);
     }
-    static CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetWhitespaceAndNewline);
-    return CFCharacterSetIsCharacterMember(set, c);
+    return direction() == DirWS;
 }
 
 bool QChar::isDigit() const
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ed6237c..90fd7a3 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2002-11-06  Richard Williamson  <rjw at apple.com>
+
+        More work on rendering scripts. Now most complex scripts render correctly.
+        Working new features include:
+        bidi, diacriticals, cursive forms, and arabic ligatures.
+        Selection of text rendered in these scripts, is however, not working. 
+        Also, line height is incorrect when renderering combined below glyphs.
+        ajami is, sadly, horrendously broken.
+
+        * Misc.subproj/WebUnicode.m:
+        (glyphVariantLogical):
+        (shapedString):
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]):
+        (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
+
 2002-11-06  John Sullivan  <sullivan at apple.com>
 
         * Bookmarks.subproj/WebBookmark.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index ed6237c..90fd7a3 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-11-06  Richard Williamson  <rjw at apple.com>
+
+        More work on rendering scripts. Now most complex scripts render correctly.
+        Working new features include:
+        bidi, diacriticals, cursive forms, and arabic ligatures.
+        Selection of text rendered in these scripts, is however, not working. 
+        Also, line height is incorrect when renderering combined below glyphs.
+        ajami is, sadly, horrendously broken.
+
+        * Misc.subproj/WebUnicode.m:
+        (glyphVariantLogical):
+        (shapedString):
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer drawCharacters:stringLength:fromCharacterPosition:toCharacterPosition:atPoint:withPadding:withTextColor:backgroundColor:rightToLeft:]):
+        (-[WebTextRenderer _floatWidthForCharacters:stringLength:fromCharacterPosition:numberOfCharacters:withPadding:applyRounding:attemptFontSubstitution:widths:fonts:glyphs:numGlyphs:]):
+
 2002-11-06  John Sullivan  <sullivan at apple.com>
 
         * Bookmarks.subproj/WebBookmark.m:
diff --git a/WebKit/Misc.subproj/WebUnicode.m b/WebKit/Misc.subproj/WebUnicode.m
index 14e0075..4e4db9f 100644
--- a/WebKit/Misc.subproj/WebUnicode.m
+++ b/WebKit/Misc.subproj/WebUnicode.m
@@ -477,7 +477,6 @@ static int glyphVariantLogical( UniChar *str, int stringLength, int pos)
 {
     // ignores L1 - L3, ligatures are job of the codec
     int joining = _unicodeJoining(str[pos]);
-    //qDebug("checking %x, joining=%d", str[pos].unicode(), joining);
     switch ( joining ) {
 	case JoiningOther:
 	case JoiningCausing:
@@ -519,6 +518,7 @@ UniChar *shapedString(UniChar *uc, int stringLength, int from, int len, int dir,
 	num--;
 	len++;
     }
+
     ch = uc + from;
     while ( len > 0 && _unicodeCombiningClass(*ch) != 0 ) {
 	ch++;
@@ -539,6 +539,7 @@ UniChar *shapedString(UniChar *uc, int stringLength, int from, int len, int dir,
     UniChar *data = shapeBuffer;
     if ( dir == RTL )
 	ch += len - 1;
+
     int i;
     for (i = 0; i < len; i++ ) {
 	UniChar r = WK_ROW(*ch);
@@ -565,7 +566,7 @@ UniChar *shapedString(UniChar *uc, int stringLength, int from, int len, int dir,
 	    if ( dir == RTL )
 		pos = from + len - 1 - i;
 	    int shape = glyphVariantLogical( uc, stringLength, pos );
-	    //qDebug("mapping U+%x to shape %d glyph=0x%x", ch->unicode(), shape, arabicUnicodeMapping[ch->cell()][shape]);
+            //printf("mapping U+%04x to shape %d glyph=0x%04x\n", *ch, shape, getShape( c, shape ));
 	    // take care of lam-alef ligatures (lam right of alef)
 	    ushort map;
 	    switch ( c ) {
@@ -577,7 +578,7 @@ UniChar *shapedString(UniChar *uc, int stringLength, int from, int len, int dir,
 			    case 0x23:
 			    case 0x25:
 			    case 0x27:
-				//qDebug(" lam of lam-alef ligature");
+				//printf("lam of lam-alef ligature");
 				map = arabicUnicodeLamAlefMapping[WK_CELL(*pch) - 0x22][shape];
 				goto next;
 			    default:
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 1dc254a..cab628d 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -447,8 +447,8 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
     if (length == 0)
         return;
                 
-    // FIXME:  the character to glyph translation must result in less than
-    // length glyphs.  This isn't always true.
+    // WARNING:  the character to glyph translation must result in less than
+    // length glyphs.  As of now this is always true.
     if (length > LOCAL_BUFFER_SIZE) {
         advances = (CGSize *)calloc(length, sizeof(CGSize));
         widthBuffer = (float *)calloc(length, sizeof(float));
@@ -461,22 +461,6 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         fontBuffer = localFontBuffer;
     }
 
-#ifdef CURSIVE_SHAPES
-    if (rtl){
-        UniChar *shaped;
-        int 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
-
     [self _floatWidthForCharacters:characters 
         stringLength:length 
         fromCharacterPosition: 0 
@@ -516,7 +500,6 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         int lastFrom = from;
         int pos = from;
 
-#ifndef CURSIVE_SHAPES
         if (rtl && numGlyphs > 1){
             int i;
             int end = numGlyphs;
@@ -543,20 +526,27 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
                 fontBuffer[end] = fswap1;
             }
         }
-#endif        
+
         currentFont = fontBuffer[pos];
         nextX = startX;
-        while (pos < to){
-            if ((fontBuffer[pos] != 0 && fontBuffer[pos] != currentFont)){
-                _drawGlyphs(currentFont, textColor, &glyphBuffer[lastFrom], &advances[lastFrom], startX, point.y, pos - lastFrom);
-                lastFrom = pos;
-                currentFont = fontBuffer[pos];
+        int nextGlyph = pos;
+        // FIXME:  Don't run over the end of the glyph buffer when the
+        // number of glyphs is less than the number of characters.  This
+        // happens when a ligature is included in the glyph run.  The code
+        // below will just stop drawing glyphs at the end of the glyph array
+        // as a temporary hack.  The appropriate fix need to map character
+        // ranges to glyph ranges.
+        while (nextGlyph < to && nextGlyph < numGlyphs){
+            if ((fontBuffer[nextGlyph] != 0 && fontBuffer[nextGlyph] != currentFont)){
+                _drawGlyphs(currentFont, textColor, &glyphBuffer[lastFrom], &advances[lastFrom], startX, point.y, nextGlyph - lastFrom);
+                lastFrom = nextGlyph;
+                currentFont = fontBuffer[nextGlyph];
                 startX = nextX;
             }
-            nextX += advances[pos].width;
-            pos++;
+            nextX += advances[nextGlyph].width;
+            nextGlyph++;
         }
-        _drawGlyphs(currentFont, textColor, &glyphBuffer[lastFrom], &advances[lastFrom], startX, point.y, pos - lastFrom);
+        _drawGlyphs(currentFont, textColor, &glyphBuffer[lastFrom], &advances[lastFrom], startX, point.y, nextGlyph - lastFrom);
     }
 
     if (advances != localAdvanceBuffer) {
@@ -673,7 +663,36 @@ static const char *joiningNames[] = {
             *_numGlyphs = 0;
         return 0;
     }
-        
+
+#define SHAPE_STRINGS
+#ifdef SHAPE_STRINGS
+    UniChar munged[stringLength];
+    {
+        UniChar *shaped;
+        int lengthOut;
+        shaped = shapedString ((UniChar *)characters, stringLength,
+                               pos,
+                               len,
+                               0, &lengthOut);
+        if (shaped){
+            //printf ("%d input, %d output\n", len, lengthOut);
+            //for (i = 0; i < (int)len; i++){
+            //    printf ("0x%04x shaped to 0x%04x\n", characters[i], shaped[i]);
+            //}
+            // FIXME:  Hack-o-rific, copy shaped buffer into munged
+            // character buffer.
+            for (i = 0; i < (unsigned int)pos; i++){
+                munged[i] = characters[i];
+            }
+            for (i = pos; i < (unsigned int)pos+lengthOut; i++){
+                munged[i] = shaped[i-pos];
+            }
+            characters = munged;
+            len = lengthOut;
+        }
+    }
+#endif
+    
     // If the padding is non-zero, count the number of spaces in the string
     // and divide that by the padding for per space addition.
     if (padding > 0){
@@ -777,8 +796,9 @@ static const char *joiningNames[] = {
                 fontBuffer[numGlyphs] = font;
             if (glyphBuffer)
                 glyphBuffer[numGlyphs] = glyphID;
-            if (widthBuffer)
+            if (widthBuffer){
                 widthBuffer[numGlyphs] = lastWidth;
+            }
             numGlyphs++;
         }
 #ifdef DEBUG_COMBINING        

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list