def _curveToOne(self, (x1, y1), (x2, y2), (x3, y3)):
        self.segmentIndex += 1
        c = self.ssglyph.contours[self.contourIndex]
        n = len(c)
        startIndex = (self.subsegments[self.contourIndex][self.segmentIndex-1][0])
        segmentCount = (self.subsegments[self.contourIndex][self.segmentIndex][1])
        endIndex = (startIndex + segmentCount + 1) % (n)

        indices = [(startIndex + i) % (n) for i in range(segmentCount + 1)]
        points = np.array([(c[i].points[0].x, c[i].points[0].y) for i in indices])
        prevPoint = (c[(startIndex - 1)].points[0].x, c[(startIndex - 1)].points[0].y)
        nextPoint = (c[(endIndex) % n].points[0].x, c[(endIndex) % n].points[0].y)
        prevTangent = prevPoint - points[0]
        nextTangent = nextPoint - points[-1]

        tangent1 = points[1] - points[0]
        tangent3 = points[-2] - points[-1]
        prevTangent /= np.linalg.norm(prevTangent)
        nextTangent /= np.linalg.norm(nextTangent)
        tangent1 /= np.linalg.norm(tangent1)
        tangent3 /= np.linalg.norm(tangent3)

        tangent1, junk = self.smoothTangents(tangent1, prevTangent, self.lastSmooth)
        tangent3, junk = self.smoothTangents(tangent3, nextTangent, self.nextSmooth)
        if self.matchTangents == True:
            cp = fitBezier(points, tangent1, tangent3)
            cp[1] = norm(cp[1] - cp[0]) * tangent1 / norm(tangent1) + cp[0]
            cp[2] = norm(cp[2] - cp[3]) * tangent3 / norm(tangent3) + cp[3]
        else:
            cp = fitBezier(points)
        # if self.ssglyph.name == 'r':
        #     print "-----------"
        #     print self.lastSmooth, self.nextSmooth
        #     print "%i %i : %i %i \n %i %i : %i %i \n %i %i : %i %i"%(x1,y1, cp[1,0], cp[1,1], x2,y2, cp[2,0], cp[2,1], x3,y3, cp[3,0], cp[3,1])
        self.otherPen.curveTo((cp[1,0], cp[1,1]), (cp[2,0], cp[2,1]), (cp[3,0], cp[3,1]))
        self.lastPoint = (x3, y3)
        self.lastSmooth = False
dataset/ETHPy150Open google/roboto/scripts/lib/fontbuild/curveFitPen.py/SubsegmentsToCurvesPen._curveToOne/original