[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 07:18:20 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 92f3789b3cc606e24e5ea705f64e6692be3b85b1
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 2 06:03:19 2003 +0000

            Obey the font smoothing size preference (3137618).
    
            Reviewed by Don and Darin.
    
            * WebCoreSupport.subproj/WebTextRenderer.m:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c74904b..dd8ee90 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-01  Richard Williamson   <rjw at apple.com>
+
+        Obey the font smoothing size preference (3137618).
+        
+        Reviewed by Don and Darin.
+
+        * WebCoreSupport.subproj/WebTextRenderer.m:
+
 2002-12-31  Maciej Stachowiak  <mjs at apple.com>
 
 	Reviewed by Darin.
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 6ada6e8..1ec02cd 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -294,11 +294,25 @@ static BOOL bufferTextDrawing = NO;
     return bufferTextDrawing;
 }
 
+static float _WebAntiAliasingThreshold = 9.0;
+
++ (void)_updateAntialiasingThreshold {
+    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
+    id val;
+
+    [userDefaults synchronize];
+    val = [userDefaults objectForKey:@"AppleAntiAliasingThreshold"];
+    _WebAntiAliasingThreshold = (val ? [val floatValue] : _WebAntiAliasingThreshold);
+}
+
 + (void)initialize
 {
     WebKitInitializeUnicode();
     nonBaseChars = CFCharacterSetGetPredefined(kCFCharacterSetNonBase);
     bufferTextDrawing = [[[NSUserDefaults standardUserDefaults] stringForKey:@"BufferTextDrawing"] isEqual: @"YES"];
+
+    [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateAntialiasingThreshold)                                                                 name:@"AppleAquaAntiAliasingChanged" object:nil                                                 suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
+    [WebTextRenderer _updateAntialiasingThreshold];
 }
 
 static inline BOOL _fontContainsString (NSFont *font, NSString *string)
@@ -614,12 +628,17 @@ static inline BOOL _fontContainsString (NSFont *font, NSString *string)
     return [font xHeight];
 }
 
-
 // Useful page for testing http://home.att.net/~jameskass
 static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *advances, float x, float y, int numGlyphs)
 {
+    NSGraphicsContext *gc = [NSGraphicsContext currentContext];
     CGContextRef cgContext;
 
+    BOOL flag = [gc shouldAntialias];
+
+    if ([font pointSize] <= _WebAntiAliasingThreshold)
+        [gc setShouldAntialias: NO];
+
     if ([WebTextRenderer shouldBufferTextDrawing] && [[WebTextRendererFactory sharedFactory] coalesceTextDrawing]){
         // Add buffered glyphs and advances
         // FIXME:  If we ever use this again, need to add RTL.
@@ -627,7 +646,7 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         [gBuffer addGlyphs: glyphs advances: advances count: numGlyphs at: x : y];
     }
     else {
-        cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
+        cgContext = (CGContextRef)[gc graphicsPort];
         // Setup the color and font.
         [color set];
         [font set];
@@ -635,6 +654,7 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         CGContextSetTextPosition (cgContext, x, y);
         CGContextShowGlyphsWithAdvances (cgContext, glyphs, advances, numGlyphs);
     }
+    [gc setShouldAntialias: flag];
 }
 
 - (void)drawCharacters:(const UniChar *)characters stringLength: (unsigned int)length fromCharacterPosition: (int)from toCharacterPosition: (int)to atPoint:(NSPoint)point withPadding: (int)padding withTextColor:(NSColor *)textColor backgroundColor: (NSColor *)backgroundColor rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list