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


The following commit has been merged in the debian/unstable branch:
commit 576bb2cf15149691d4b5550e2faac0493e45fd16
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 6 02:35:17 2002 +0000

            Added additional check to find appropriate fonts with available
            weight, rather than always using a weight of 5.
    
            Regarding "kCGErrorFailure : can't find name id 4 for font id 8395" errors:
            CG appears to be lying to us about some fonts, Verdana in particular.
            It claims to have an available Verdana font w/ the correct traits, but spits errors
            when we request that font.  Further, the Font Panel behaves oddly when you request
            Verdana.  The panel displays the font but if you select the font it doesn't
            'stick'.  A mystery.
    
            * WebCoreSupport.subproj/WebTextRendererFactory.m:
            (-[WebTextRendererFactory fontWithFamily:traits:size:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1e56c97..9a707f2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2002-08-05  Richard Williamson (Home)  <rjw at apple.com>
+
+        Added additional check to find appropriate fonts with available
+        weight, rather than always using a weight of 5.
+        
+        Regarding "kCGErrorFailure : can't find name id 4 for font id 8395" errors:
+        CG appears to be lying to us about some fonts, Verdana in particular.
+        It claims to have an available Verdana font w/ the correct traits, but spits errors
+        when we request that font.  Further, the Font Panel behaves oddly when you request
+        Verdana.  The panel displays the font but if you select the font it doesn't
+        'stick'.  A mystery.
+        
+        * WebCoreSupport.subproj/WebTextRendererFactory.m:
+        (-[WebTextRendererFactory fontWithFamily:traits:size:]):
+
 2002-08-05  Darin Adler  <darin at apple.com>
 
 	- fixed 2986567 -- suppress return characters from title in title bar, status bar, menu items
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 1e56c97..9a707f2 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,18 @@
+2002-08-05  Richard Williamson (Home)  <rjw at apple.com>
+
+        Added additional check to find appropriate fonts with available
+        weight, rather than always using a weight of 5.
+        
+        Regarding "kCGErrorFailure : can't find name id 4 for font id 8395" errors:
+        CG appears to be lying to us about some fonts, Verdana in particular.
+        It claims to have an available Verdana font w/ the correct traits, but spits errors
+        when we request that font.  Further, the Font Panel behaves oddly when you request
+        Verdana.  The panel displays the font but if you select the font it doesn't
+        'stick'.  A mystery.
+        
+        * WebCoreSupport.subproj/WebTextRendererFactory.m:
+        (-[WebTextRendererFactory fontWithFamily:traits:size:]):
+
 2002-08-05  Darin Adler  <darin at apple.com>
 
 	- fixed 2986567 -- suppress return characters from title in title bar, status bar, menu items
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
index 58ab1b6..785d069 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m
@@ -118,14 +118,40 @@
     e = [[[NSFontManager sharedFontManager] availableFontFamilies] objectEnumerator];
     while ((availableFamily = [e nextObject])) {
         if ([family caseInsensitiveCompare:availableFamily] == NSOrderedSame) {
-            font = [[NSFontManager sharedFontManager] fontWithFamily:availableFamily traits:traits weight:5 size:size];
-            if (font != nil) {
-                return font;
+            NSArray *fonts = [[NSFontManager sharedFontManager] availableMembersOfFontFamily:availableFamily];
+            NSArray *fontInfo;
+            NSFontTraitMask fontMask;
+            int fontWeight;
+            unsigned i;
+        
+            for (i = 0; i < [fonts count]; i++){
+                fontInfo = [fonts objectAtIndex: i];
+                
+                // Hard coded positions depend on lame AppKit API.
+                fontWeight = [[fontInfo objectAtIndex: 2] intValue];
+                fontMask = [[fontInfo objectAtIndex: 3] unsignedIntValue];
+                
+                // First look for a 'normal' weight font.  The weight and mask
+                // properties are somewhat conflicting.
+                if (fontWeight == 5 && (fontMask & traits) == traits){
+                    font = [[NSFontManager sharedFontManager] fontWithFamily:availableFamily traits:traits weight:5 size:size];
+                    if (font != nil) {
+                        return font;
+                    }
+                } 
+                
+                // Get a font with the correct traits but a weight we're told actually exists.
+                if ((fontMask & traits) == traits){
+                    font = [[NSFontManager sharedFontManager] fontWithFamily:availableFamily traits:traits weight:fontWeight size:size];
+                    if (font != nil) {
+                        return font;
+                    }
+                } 
             }
         }
     }
-            
-    WEBKITDEBUGLEVEL(WEBKIT_LOG_FONTCACHE, "unable to find font for family %s", [family lossyCString]);
+    
+    //NSLog(@"unable to find font for family %@, traits 0x%08x(%d), size %f", family, traits, traits, size);
     return [[NSFontManager sharedFontManager] fontWithFamily:@"Helvetica" traits:traits weight:5 size:size];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list