[webkit-changes] cvs commit: WebKit/WebCoreSupport.subproj WebTextRenderer.m

Darin darin at opensource.apple.com
Thu Oct 6 14:00:39 PDT 2005


darin       05/10/06 14:00:39

  Modified:    .        ChangeLog
               WebCoreSupport.subproj WebTextRenderer.m
  Log:
          Reviewed by Eric.
  
          - fixed regression in drawing of text in non-flipped contexts from my last check-in
  
          * WebCoreSupport.subproj/WebTextRenderer.m:
          (drawGlyphs): Only flip the matrix if the NSGraphicsContext is flipped.
          (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Use -[NSGraphicsContext isFlipped]
          instead of [[NSView focusView] isFlipped].
  
  Revision  Changes    Path
  1.3341    +11 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3340
  retrieving revision 1.3341
  diff -u -r1.3340 -r1.3341
  --- ChangeLog	6 Oct 2005 15:45:57 -0000	1.3340
  +++ ChangeLog	6 Oct 2005 21:00:34 -0000	1.3341
  @@ -1,5 +1,16 @@
   2005-10-06  Darin Adler  <darin at apple.com>
   
  +        Reviewed by Eric.
  +
  +        - fixed regression in drawing of text in non-flipped contexts from my last check-in
  +
  +        * WebCoreSupport.subproj/WebTextRenderer.m:
  +        (drawGlyphs): Only flip the matrix if the NSGraphicsContext is flipped.
  +        (-[WebTextRenderer _ATSU_drawRun:style:geometry:]): Use -[NSGraphicsContext isFlipped]
  +        instead of [[NSView focusView] isFlipped].
  +
  +2005-10-06  Darin Adler  <darin at apple.com>
  +
           Reviewed by Hyatt.
   
           - fixed <rdar://problem/3217793> Monaco bold comes out as Helvetica bold, very bad if you choose Monaco as your fixed-width font
  
  
  
  1.194     +7 -4      WebKit/WebCoreSupport.subproj/WebTextRenderer.m
  
  Index: WebTextRenderer.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebTextRenderer.m,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- WebTextRenderer.m	6 Oct 2005 15:46:09 -0000	1.193
  +++ WebTextRenderer.m	6 Oct 2005 21:00:38 -0000	1.194
  @@ -844,8 +844,10 @@
   
       CGAffineTransform matrix;
       memcpy(&matrix, [drawFont matrix], sizeof(matrix));
  -    matrix.b = -matrix.b;
  -    matrix.d = -matrix.d;
  +    if ([gContext isFlipped]) {
  +        matrix.b = -matrix.b;
  +        matrix.d = -matrix.d;
  +    }
       if (syntheticOblique)
           matrix = CGAffineTransformConcat(matrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0)); 
       CGContextSetTextMatrix(cgContext, matrix);
  @@ -1522,9 +1524,10 @@
       [style->textColor set];
   
       // ATSUI can't draw beyond -32768 to +32767 so we translate the CTM and tell ATSUI to draw at (0, 0).
  -    CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
  +    NSGraphicsContext *gContext = [NSGraphicsContext currentContext];
  +    CGContextRef context = (CGContextRef)[gContext graphicsPort];
       CGContextTranslateCTM(context, geometry->point.x, geometry->point.y);
  -    BOOL flipped = [[NSView focusView] isFlipped];
  +    BOOL flipped = [gContext isFlipped];
       if (!flipped)
           CGContextScaleCTM(context, 1.0, -1.0);
       status = ATSUDrawText(params.layout, aRun->from, runLength, 0, 0);
  
  
  



More information about the webkit-changes mailing list