--- /cygdrive/c/usr/matsuhashi/swfmill-0.2.11/src/swft/swft_import_ttf.cpp 2005-09-30 04:09:16.000000000 +0900 +++ /cygdrive/c/usr/local/lib/swfmill-0.2.11/src/swft/swft_import_ttf.cpp 2006-12-08 15:32:31.445375000 +0900 @@ -215,16 +215,48 @@ bool control, cubic; int n; for( int contour = 0; contour < outline->n_contours; contour++ ) { end = outline->contours[contour]; n=0; + /* + * If the outline starting point is "off the curve", reorder the points array. + * Shift the starting point off and move it the end of outline points. + */ + control = !(outline->tags[start] & 0x01); + if (control) { + FT_Vector pointsBuffer[(end+1)-start]; + char tagsBuffer[(end+1)-start]; + int i,j; + for (i=0, j=start; j<=end; i++, j++ ) { + // save the original points to temporary area + pointsBuffer[i].x = outline->points[j].x; + pointsBuffer[i].y = outline->points[j].y; + tagsBuffer[i] = outline->tags[j]; + } + for (i=0, j=start; j<=end; i++, j++ ) { + if (i==0) { + // move the original starting point to the tail + outline->points[end].x = pointsBuffer[0].x; + outline->points[end].y = pointsBuffer[0].y; + outline->tags[end] = tagsBuffer[0]; + } else { + // just shift the other points + outline->points[j-1].x = pointsBuffer[i].x; + outline->points[j-1].y = pointsBuffer[i].y; + outline->tags[j-1] = tagsBuffer[i]; + } + } + } for( int p = start; p<=end; p++ ) { control = !(outline->tags[p] & 0x01); cubic = outline->tags[p] & 0x02; if( p==start ) { + if (control) { + fprintf(stderr,"outline starting with a control point; glyph &#%i; of %s .\n", character, filename); + } shaper.setup( outline->points[p-n].x, outline->points[p-n].y ); } if( !control && n > 0 ) { importGlyphPoints( &(outline->points[(p-n)+1]), n-1, shaper, cubic );