- roll out this change, since it causes a 1.5% performance regression
authorvicki <vicki@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2005 23:04:38 +0000 (23:04 +0000)
committervicki <vicki@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2005 23:04:38 +0000 (23:04 +0000)
    2005-02-15  Richard Williamson   <rjw@apple.com>

        Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead

        Lie about Osaka-Mono.  Treat it as fixed pitch, even though,
        strictly speaking it isn't.  (Similar to what we do with
        Courier New.)

        Reviewed by David Harrison.

        * WebCoreSupport.subproj/WebTextRenderer.m:
        (-[WebTextRenderer _computeWidthForSpace]):
        * WebCoreSupport.subproj/WebTextRendererFactory.h:
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        (-[NSFont _web_isFakeFixedPitch]):
        (-[WebTextRendererFactory isFontFixedPitch:]):
        (-[WebTextRendererFactory fontWithFamily:traits:size:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8614 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebTextRenderer.m
WebKit/WebCoreSupport.subproj/WebTextRendererFactory.h
WebKit/WebCoreSupport.subproj/WebTextRendererFactory.m

index 9c7164109f7e1525db2e083563c4d38c49759ea9..c6a29a591e8df00d60a27f7e4938895964dbbc65 100644 (file)
@@ -1,3 +1,25 @@
+2005-02-17  Vicki Murley <vicki@apple.com>
+
+       - roll out this change, since it causes a 1.5% performance regression
+
+    2005-02-15  Richard Williamson   <rjw@apple.com>
+        
+        Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
+        
+        Lie about Osaka-Mono.  Treat it as fixed pitch, even though,
+        strictly speaking it isn't.  (Similar to what we do with
+        Courier New.)
+
+        Reviewed by David Harrison.
+
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+        (-[WebTextRenderer _computeWidthForSpace]):
+        * WebCoreSupport.subproj/WebTextRendererFactory.h:
+        * WebCoreSupport.subproj/WebTextRendererFactory.m:
+        (-[NSFont _web_isFakeFixedPitch]): 
+        (-[WebTextRendererFactory isFontFixedPitch:]):
+        (-[WebTextRendererFactory fontWithFamily:traits:size:]):
+
 2005-02-17  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Ken.
index 85a7cb07b1b1007fc35234bfc1866b0005f9e451..9b9fcbac0742dbb61faf7a5148d1cece81d30ee3 100644 (file)
@@ -846,7 +846,7 @@ static inline BOOL fontContainsString(NSFont *font, NSString *string)
     float width = widthForGlyph(self, spaceGlyph, 0);
     spaceWidth = width;
 
-    treatAsFixedPitch = [font isFixedPitch] || [font _isFakeFixedPitch] || [font _web_isFakeFixedPitch];
+    treatAsFixedPitch = [font isFixedPitch] || [font _isFakeFixedPitch];
     adjustedSpaceWidth = treatAsFixedPitch ? CEIL_TO_INT(width) : ROUND_TO_INT(width);
     
     return YES;
index 6e3306ccbe741c64e67e19644da7a74849f2bdef..f75aff6a4249d7726f6eae202b17397963de864c 100644 (file)
@@ -29,8 +29,3 @@
 - (WebGlyphBuffer *)glyphBufferForFont:(NSFont *)font andColor:(NSColor *)color;
 
 @end
-
-@interface NSFont (WebPrivateExtensions)
-- (BOOL)_web_isFakeFixedPitch;
-@end
-
index ebac34927f551f6eb5229059cfd0921c99df347c..dd2015ad680adf3452b8771ee78e485d1ce6c716 100644 (file)
 - (BOOL)_isFakeFixedPitch;
 @end
 
-@implementation NSFont (WebPrivateExtensions)
-- (BOOL)_web_isFakeFixedPitch
-{
-    // Special case Osaka-Mono.  According to <rdar://problem/3999467>, we should treat Osaka-Mono
-    // as fixed pitch.
-    if ([[self fontName] caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame)
-       return YES;
-    return NO;
-}
-@end
-
-
 @implementation WebTextRendererFactory
 
 - (BOOL)coalesceTextDrawing
@@ -261,7 +249,7 @@ fontsChanged( ATSFontNotificationInfoRef info, void *_factory)
 
 - (BOOL)isFontFixedPitch: (NSFont *)font
 {
-    return [font isFixedPitch] || [font _isFakeFixedPitch] || [font _web_isFakeFixedPitch];
+    return [font isFixedPitch] || [font _isFakeFixedPitch];
 }
 
 - init
@@ -437,14 +425,6 @@ static BOOL betterChoice(NSFontTraitMask desiredTraits, int desiredWeight,
     while ((availableFont = [availableFonts nextObject])) {
         if ([desiredFamily caseInsensitiveCompare:availableFont] == NSOrderedSame) {
             NSFont *nameMatchedFont = [NSFont fontWithName:availableFont size:size];
-           
-           // Special case Osaka-Mono.  According to <rdar://problem/3999467>, we need to 
-           // treat Osaka-Mono as fixed pitch.
-           if ([desiredFamily caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame && desiredTraits == 0) {
-               LOG (FontSelection, "found exact match for Osaka-Mono\n");
-               return nameMatchedFont;
-           }
-           
             NSFontTraitMask traits = [fontManager traitsOfFont:nameMatchedFont];
             
             if ((traits & desiredTraits) == desiredTraits){