[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 05:59:39 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c7e0c1b5d6af98d87b55febf87dfa3dc2319b742
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Mar 30 20:57:26 2002 +0000

            Twiddling with baselines.  kde 2.2 appears to not line up baselines correctly.
            Need to experiment with kde 3.
    
            Removed copy of function prototype, instead included the correct header.
    
    	Fixed crasher in setFocusPolicy, I don't think we even need to use kde's focus policy.
            This was added during the kde 3 beta 2 merge.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index bc72533..0a89f0f 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
+        Twiddling with baselines.  kde 2.2 appears to not line up baselines correctly.
+        Need to experiment with kde 3.
+        
+        Removed copy of function prototype, instead included the correct header.
+ 
+	Fixed crasher in setFocusPolicy, I don't think we even need to use kde's focus policy.
+        This was added during the kde 3 beta 2 merge.
+       
+	* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo
+	drawString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	drawUnderlineForString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	initWithFont:]), (-[KWQLayoutInfo _initializeCaches]):
+	* src/kwq/KWQMetrics.h:
+	* src/kwq/KWQWidget.mm: (QWidget::setFocusProxy):
+
 2002-03-30  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKURL.mm: (copyAndReplaceAll), (needToHideColons): New
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index bc72533..0a89f0f 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
+        Twiddling with baselines.  kde 2.2 appears to not line up baselines correctly.
+        Need to experiment with kde 3.
+        
+        Removed copy of function prototype, instead included the correct header.
+ 
+	Fixed crasher in setFocusPolicy, I don't think we even need to use kde's focus policy.
+        This was added during the kde 3 beta 2 merge.
+       
+	* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo
+	drawString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	drawUnderlineForString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	initWithFont:]), (-[KWQLayoutInfo _initializeCaches]):
+	* src/kwq/KWQMetrics.h:
+	* src/kwq/KWQWidget.mm: (QWidget::setFocusProxy):
+
 2002-03-30  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKURL.mm: (copyAndReplaceAll), (needToHideColons): New
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index bc72533..0a89f0f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
+        Twiddling with baselines.  kde 2.2 appears to not line up baselines correctly.
+        Need to experiment with kde 3.
+        
+        Removed copy of function prototype, instead included the correct header.
+ 
+	Fixed crasher in setFocusPolicy, I don't think we even need to use kde's focus policy.
+        This was added during the kde 3 beta 2 merge.
+       
+	* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo
+	drawString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	drawUnderlineForString:atPoint:withFont:color:]), (-[KWQLayoutInfo
+	initWithFont:]), (-[KWQLayoutInfo _initializeCaches]):
+	* src/kwq/KWQMetrics.h:
+	* src/kwq/KWQWidget.mm: (QWidget::setFocusProxy):
+
 2002-03-30  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKURL.mm: (copyAndReplaceAll), (needToHideColons): New
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index e3a53f0..cb686e1 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -258,8 +258,8 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
         }
         cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
         CGContextSetCharacterSpacing(cgContext, 0.0);
-        //CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + [frag boundingRect].size.height + (int)[font descender] - 1, (const short unsigned int *)usedGlyphBuf, numGlyphs);
-        CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + lineHeight - 1 - (int)[font descender], (const short unsigned int *)usedGlyphBuf, numGlyphs);
+        //CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + lineHeight - 1 - ROUND_TO_INT(-[font descender]), (const short unsigned int *)usedGlyphBuf, numGlyphs);
+        CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + [font defaultLineHeightForFont] - 1, (const short unsigned int *)usedGlyphBuf, numGlyphs);
         
         if (glyphBuf)
             free (glyphBuf);
@@ -306,8 +306,10 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
         lineWidth = size.width;
     }
     CGContextSetLineWidth(cgContext, lineWidth);
-    CGContextMoveToPoint(cgContext, p.x, p.y + lineHeight + 0.5 - (int)[font descender]);
-    CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + lineHeight + 0.5 - (int)[font descender]);
+    ///CGContextMoveToPoint(cgContext, p.x, p.y + lineHeight + 0.5 - ROUND_TO_INT(-[font descender]));
+    //CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + lineHeight + 0.5 - ROUND_TO_INT(-[font descender]));
+    CGContextMoveToPoint(cgContext, p.x, p.y + [font defaultLineHeightForFont] + 0.5);
+    CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + [font defaultLineHeightForFont] + 0.5);
     CGContextStrokePath(cgContext);
 
     [graphicsContext setShouldAntialias: flag];
@@ -404,7 +406,7 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
     [super init];
 
     font = [aFont retain];
-    lineHeight = ROUND_TO_INT([font ascender]) - ROUND_TO_INT([font descender]) + 1;
+    lineHeight = ROUND_TO_INT([font ascender]) + ROUND_TO_INT(-[font descender]) + 1;
 
 #ifdef DIRECT_TO_CG
     ATSUStyle style;
@@ -451,6 +453,10 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
 #endif
 }
 
+#define CONTEXT_DPI    (72.0)
+#define ScaleEmToUnits(X, U_PER_EM)    (X * ((1.0 * CONTEXT_DPI) / (CONTEXT_DPI * U_PER_EM)))
+#define ScaleUnitsToPoints(F, POINTS)  (F * POINTS)
+
 #ifdef DIRECT_TO_CG
 - (void)_initializeCaches
 {
@@ -459,8 +465,8 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
     size_t numGlyphsInFont = CGFontGetNumberOfGlyphs([font _backingCGSFont]);
     short unsigned int sequentialGlyphs[INITIAL_GLYPH_CACHE_MAX];
     ATSLayoutRecord *glyphRecords;
-            
-    KWQDEBUGLEVEL3 (KWQ_LOG_FONTCACHE, "Caching %s %.0f (%ld glyphs)\n", [[font displayName] cString], [font pointSize], numGlyphsInFont); 
+
+    KWQDEBUGLEVEL6 (KWQ_LOG_FONTCACHE, "Caching %s %.0f (%ld glyphs) ascent = %f, descent = %f, defaultLineHeightForFont = %f\n", [[font displayName] cString], [font pointSize], numGlyphsInFont, [font ascender], [font descender], [font defaultLineHeightForFont]); 
 
     // Initially just cache the max of number of glyphs in font or
     // INITIAL_GLYPH_CACHE_MAX.  Holes in the cache will be filled on demand
diff --git a/WebCore/kwq/KWQMetrics.h b/WebCore/kwq/KWQMetrics.h
index 9d2837c..5584e1c 100644
--- a/WebCore/kwq/KWQMetrics.h
+++ b/WebCore/kwq/KWQMetrics.h
@@ -55,6 +55,7 @@
 
 #import <ApplicationServices/ApplicationServices.h>
 #import <ATSUnicodePriv.h>
+#import <CoreGraphics/CGFontPrivate.h>
 
 #undef Fixed
 #undef Rect
@@ -65,13 +66,6 @@
 - (CGFontRef) _backingCGSFont;
 @end
 
-extern "C" {
-
-CG_EXTERN int CGFontGetGlyphScaledAdvances(CGFontRef font, const CGGlyph glyph[], size_t count, float advance[], float scale);
-CG_EXTERN size_t CGFontGetNumberOfGlyphs(CGFontRef font);
-
-}
-
 //typedef unsigned short _IFGlyphWidth;
 typedef float _IFGlyphWidth;
 
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 0b82eb1..570b2a1 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -276,7 +276,10 @@ void QWidget::setFocusPolicy(FocusPolicy fp)
 
 void QWidget::setFocusProxy( QWidget *w)
 {
-    data->focusPolicy = w->focusPolicy();
+    if (w != 0)
+        data->focusPolicy = w->focusPolicy();
+    // else?  FIXME: [rjw] we need to understand kde's focus policy.  I don't
+    // think this is even relevant for us.
 }
 
 
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index e3a53f0..cb686e1 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -258,8 +258,8 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
         }
         cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
         CGContextSetCharacterSpacing(cgContext, 0.0);
-        //CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + [frag boundingRect].size.height + (int)[font descender] - 1, (const short unsigned int *)usedGlyphBuf, numGlyphs);
-        CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + lineHeight - 1 - (int)[font descender], (const short unsigned int *)usedGlyphBuf, numGlyphs);
+        //CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + lineHeight - 1 - ROUND_TO_INT(-[font descender]), (const short unsigned int *)usedGlyphBuf, numGlyphs);
+        CGContextShowGlyphsAtPoint (cgContext, p.x, p.y + [font defaultLineHeightForFont] - 1, (const short unsigned int *)usedGlyphBuf, numGlyphs);
         
         if (glyphBuf)
             free (glyphBuf);
@@ -306,8 +306,10 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
         lineWidth = size.width;
     }
     CGContextSetLineWidth(cgContext, lineWidth);
-    CGContextMoveToPoint(cgContext, p.x, p.y + lineHeight + 0.5 - (int)[font descender]);
-    CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + lineHeight + 0.5 - (int)[font descender]);
+    ///CGContextMoveToPoint(cgContext, p.x, p.y + lineHeight + 0.5 - ROUND_TO_INT(-[font descender]));
+    //CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + lineHeight + 0.5 - ROUND_TO_INT(-[font descender]));
+    CGContextMoveToPoint(cgContext, p.x, p.y + [font defaultLineHeightForFont] + 0.5);
+    CGContextAddLineToPoint(cgContext, p.x + rect.size.width, p.y + [font defaultLineHeightForFont] + 0.5);
     CGContextStrokePath(cgContext);
 
     [graphicsContext setShouldAntialias: flag];
@@ -404,7 +406,7 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
     [super init];
 
     font = [aFont retain];
-    lineHeight = ROUND_TO_INT([font ascender]) - ROUND_TO_INT([font descender]) + 1;
+    lineHeight = ROUND_TO_INT([font ascender]) + ROUND_TO_INT(-[font descender]) + 1;
 
 #ifdef DIRECT_TO_CG
     ATSUStyle style;
@@ -451,6 +453,10 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
 #endif
 }
 
+#define CONTEXT_DPI    (72.0)
+#define ScaleEmToUnits(X, U_PER_EM)    (X * ((1.0 * CONTEXT_DPI) / (CONTEXT_DPI * U_PER_EM)))
+#define ScaleUnitsToPoints(F, POINTS)  (F * POINTS)
+
 #ifdef DIRECT_TO_CG
 - (void)_initializeCaches
 {
@@ -459,8 +465,8 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
     size_t numGlyphsInFont = CGFontGetNumberOfGlyphs([font _backingCGSFont]);
     short unsigned int sequentialGlyphs[INITIAL_GLYPH_CACHE_MAX];
     ATSLayoutRecord *glyphRecords;
-            
-    KWQDEBUGLEVEL3 (KWQ_LOG_FONTCACHE, "Caching %s %.0f (%ld glyphs)\n", [[font displayName] cString], [font pointSize], numGlyphsInFont); 
+
+    KWQDEBUGLEVEL6 (KWQ_LOG_FONTCACHE, "Caching %s %.0f (%ld glyphs) ascent = %f, descent = %f, defaultLineHeightForFont = %f\n", [[font displayName] cString], [font pointSize], numGlyphsInFont, [font ascender], [font descender], [font defaultLineHeightForFont]); 
 
     // Initially just cache the max of number of glyphs in font or
     // INITIAL_GLYPH_CACHE_MAX.  Holes in the cache will be filled on demand
diff --git a/WebCore/src/kwq/KWQMetrics.h b/WebCore/src/kwq/KWQMetrics.h
index 9d2837c..5584e1c 100644
--- a/WebCore/src/kwq/KWQMetrics.h
+++ b/WebCore/src/kwq/KWQMetrics.h
@@ -55,6 +55,7 @@
 
 #import <ApplicationServices/ApplicationServices.h>
 #import <ATSUnicodePriv.h>
+#import <CoreGraphics/CGFontPrivate.h>
 
 #undef Fixed
 #undef Rect
@@ -65,13 +66,6 @@
 - (CGFontRef) _backingCGSFont;
 @end
 
-extern "C" {
-
-CG_EXTERN int CGFontGetGlyphScaledAdvances(CGFontRef font, const CGGlyph glyph[], size_t count, float advance[], float scale);
-CG_EXTERN size_t CGFontGetNumberOfGlyphs(CGFontRef font);
-
-}
-
 //typedef unsigned short _IFGlyphWidth;
 typedef float _IFGlyphWidth;
 
diff --git a/WebCore/src/kwq/KWQWidget.mm b/WebCore/src/kwq/KWQWidget.mm
index 0b82eb1..570b2a1 100644
--- a/WebCore/src/kwq/KWQWidget.mm
+++ b/WebCore/src/kwq/KWQWidget.mm
@@ -276,7 +276,10 @@ void QWidget::setFocusPolicy(FocusPolicy fp)
 
 void QWidget::setFocusProxy( QWidget *w)
 {
-    data->focusPolicy = w->focusPolicy();
+    if (w != 0)
+        data->focusPolicy = w->focusPolicy();
+    // else?  FIXME: [rjw] we need to understand kde's focus policy.  I don't
+    // think this is even relevant for us.
 }
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list