@@ -513,6 +513,7 @@ FT2Font::get_path()
513513 for (n = 0 ; n < outline.n_contours ; n++)
514514 {
515515 int last; // index of last point in contour
516+ bool starts_with_last;
516517
517518 last = outline.contours [n];
518519 limit = outline.points + last;
@@ -531,13 +532,22 @@ FT2Font::get_path()
531532 {
532533 throw Py::RuntimeError (" A contour cannot start with a cubic control point" );
533534 }
535+ else if (tag == FT_CURVE_TAG_CONIC)
536+ {
537+ starts_with_last = true ;
538+ } else {
539+ starts_with_last = false ;
540+ }
534541
535542 count++;
536543
537544 while (point < limit)
538545 {
539- point++;
540- tags++;
546+ if (!starts_with_last) {
547+ point++;
548+ tags++;
549+ }
550+ starts_with_last = false ;
541551
542552 tag = FT_CURVE_TAG (tags[0 ]);
543553 switch (tag)
@@ -633,7 +643,8 @@ FT2Font::get_path()
633643 first = 0 ;
634644 for (n = 0 ; n < outline.n_contours ; n++)
635645 {
636- int last; // index of last point in contour
646+ int last; // index of last point in contour
647+ bool starts_with_last;
637648
638649 last = outline.contours [n];
639650 limit = outline.points + last;
@@ -647,16 +658,29 @@ FT2Font::get_path()
647658 tags = outline.tags + first;
648659 tag = FT_CURVE_TAG (tags[0 ]);
649660
650- double x = conv (v_start.x );
651- double y = flip_y ? -conv (v_start.y ) : conv (v_start.y );
661+ double x, y;
662+ if (tag != FT_CURVE_TAG_ON)
663+ {
664+ x = conv (v_last.x );
665+ y = flip_y ? -conv (v_last.y ) : conv (v_last.y );
666+ starts_with_last = true ;
667+ } else {
668+ x = conv (v_start.x );
669+ y = flip_y ? -conv (v_start.y ) : conv (v_start.y );
670+ starts_with_last = false ;
671+ }
672+
652673 *(outpoints++) = x;
653674 *(outpoints++) = y;
654675 *(outcodes++) = MOVETO;
655676
656677 while (point < limit)
657678 {
658- point++;
659- tags++;
679+ if (!starts_with_last) {
680+ point++;
681+ tags++;
682+ }
683+ starts_with_last = false ;
660684
661685 tag = FT_CURVE_TAG (tags[0 ]);
662686 switch (tag)
0 commit comments