Changeset 181

Show
Ignore:
Timestamp:
01/09/07 16:10:18
Author:
dan
Message:

reorder point array for glyphs starting with a control point,
fixes #13 (thanks to Kazuaki MATSUHASHI).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/swft/swft_import_ttf.cpp

    r155 r181  
    197197                        n=0; 
    198198 
     199            /* 
     200             * If the outline starting point is "off the curve", reorder the points array. 
     201             * Shift the starting point off and move it the end of outline points. 
     202             */ 
     203            control = !(outline->tags[start] & 0x01); 
     204            if (control) { 
     205             FT_Vector pointsBuffer[(end+1)-start]; 
     206             char tagsBuffer[(end+1)-start]; 
     207             int i,j; 
     208             for (i=0, j=start; j<=end; i++, j++ ) { 
     209               // save the original points to temporary area 
     210               pointsBuffer[i].x = outline->points[j].x; 
     211               pointsBuffer[i].y = outline->points[j].y; 
     212               tagsBuffer[i] = outline->tags[j]; 
     213             } 
     214             for (i=0, j=start; j<=end; i++, j++ ) { 
     215                 if (i==0) { 
     216                 // move the original starting point to the tail 
     217                   outline->points[end].x = pointsBuffer[0].x; 
     218                   outline->points[end].y = pointsBuffer[0].y; 
     219                   outline->tags[end] = tagsBuffer[0]; 
     220                } else { 
     221                  // just shift the other points 
     222                   outline->points[j-1].x = pointsBuffer[i].x; 
     223                   outline->points[j-1].y = pointsBuffer[i].y; 
     224                   outline->tags[j-1] = tagsBuffer[i]; 
     225                } 
     226             } 
     227            } 
     228 
    199229                        for( int p = start; p<=end; p++ ) { 
    200230                                control = !(outline->tags[p] & 0x01);