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

Richard rjw at opensource.apple.com
Fri Jun 17 10:09:36 PDT 2005


rjw         05/06/17 10:09:36

  Modified:    .        ChangeLog
               WebCoreSupport.subproj WebTextRenderer.m
  Log:
  Bug #:
  	Changes by Mitz Pettel
          Reviewed by Richard Williamson.
  
  	Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3545
  
          * WebCoreSupport.subproj/WebTextRenderer.m:
          (reverseCharactersInRun):
          (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]):
  
  Revision  Changes    Path
  1.3197    +11 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3196
  retrieving revision 1.3197
  diff -u -r1.3196 -r1.3197
  --- ChangeLog	17 Jun 2005 15:06:55 -0000	1.3196
  +++ ChangeLog	17 Jun 2005 17:09:32 -0000	1.3197
  @@ -1,3 +1,14 @@
  +2005-06-17  Richard Williamson   <rjw at apple.com>
  +
  +	Changes by Mitz Pettel
  +        Reviewed by Richard Williamson.
  +
  +	Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3545
  +
  +        * WebCoreSupport.subproj/WebTextRenderer.m:
  +        (reverseCharactersInRun):
  +        (-[WebTextRenderer _ATSU_pointToOffset:style:position:reversed:includePartialGlyphs:]):
  +
   2005-06-17  John Sullivan  <sullivan at apple.com>
   
           Reviewed by Chris.
  
  
  
  1.173     +10 -9     WebKit/WebCoreSupport.subproj/WebTextRenderer.m
  
  Index: WebTextRenderer.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebTextRenderer.m,v
  retrieving revision 1.172
  retrieving revision 1.173
  diff -u -r1.172 -r1.173
  --- WebTextRenderer.m	7 Jun 2005 00:54:06 -0000	1.172
  +++ WebTextRenderer.m	17 Jun 2005 17:09:36 -0000	1.173
  @@ -52,6 +52,8 @@
   #define SPACE 0x0020
   #define NO_BREAK_SPACE 0x00A0
   #define ZERO_WIDTH_SPACE 0x200B
  +#define POP_DIRECTIONAL_FORMATTING 0x202C
  +#define LEFT_TO_RIGHT_OVERRIDE 0x202D
   
   // Lose precision beyond 1000ths place. This is to work around an apparent
   // bug in CoreGraphics where there seem to be small errors to some metrics.
  @@ -1570,16 +1572,15 @@
   static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
   {
       WebCoreTextRun swappedRun;
  -    unsigned int i;
       
  -    UniChar *swappedCharacters = (UniChar *)malloc(sizeof(UniChar)*run->length);
  -    for (i = 0; i < run->length; i++) {
  -        swappedCharacters[i] = run->characters[run->length-i-1];
  -    }
  +    UniChar *swappedCharacters = (UniChar *)malloc(sizeof(UniChar)*(run->length+2));
  +    memcpy(swappedCharacters+1, run->characters, sizeof(UniChar)*run->length);
  +    swappedRun.from = run->from;
  +    swappedRun.to = (run->to == -1 ? -1 : run->to+2);
  +    swappedRun.length = run->length+2;
  +    swappedCharacters[(swappedRun.from == -1 ? 0 : swappedRun.from)] = LEFT_TO_RIGHT_OVERRIDE;
  +    swappedCharacters[(swappedRun.to == -1 ? swappedRun.length : (unsigned)swappedRun.to) - 1] = POP_DIRECTIONAL_FORMATTING;
       swappedRun.characters = swappedCharacters;
  -    swappedRun.from = run->length - (run->to == -1 ? (int)run->length : run->to);
  -    swappedRun.to = run->length - (run->from == -1 ? 0 : run->from);
  -    swappedRun.length = run->length;
   
       return swappedRun;
   }
  @@ -1724,7 +1725,7 @@
       const WebCoreTextRun *aRun = run;
       WebCoreTextRun swappedRun;
       
  -    // Reverse the visually ordered characters.  ATSU will re-reverse.  Ick!
  +    // Enclose in LRO-PDF to force ATSU to render visually.
       if (style->visuallyOrdered) {
           swappedRun = reverseCharactersInRun(run);
           aRun = &swappedRun;
  
  
  



More information about the webkit-changes mailing list