我尝试捕获字形点/路径(不使用字体)。我将字形转换为UFO。
<contour>
<point x="281" y="646" type="qcurve"/>
<point x="273" y="599"/>
<point x="225" y="411"/>
<point x="216" y="363" type="qcurve"/>
<point x="320" y="382"/>
<point x="426" y="445" type="qcurve"/>
<point x="603" y="552"/>
<point x="603" y="626" type="qcurve"/>
<point x="603" y="676"/>
<point x="502" y="676" type="qcurve"/>
<point x="420" y="676"/>
</contour>
根据手册,qcurve
代表quadratic curves
从 TrueType 派生。因此,我们可以从一个二次控制点计算出两个贝塞尔控制点
CP1 = QP0 + 2/3 *(QP1-QP0)
CP2 = QP2 + 2/3 *(QP1-QP2)
在这种情况下,我们应该在两点之间有一个控制点(参见前四行;有两个控制点)。
我们如何将具有两个控制点的二次曲线转换为贝塞尔曲线?