totX[pt] = xx, totY[pt] = yy, totOnCurve[pt] = oc;
-//A way to fix the kludge in GetPoly() would be to put a check here to see if
+//A way to fix the kludge in GetPoly() would be to put a check here to see if
//we're adding to the end of the structure: [DONE, below]
int polyInsert = (pt == numPoints ? numPolys - 1 : GetPoly(pt));
for(int i=polyInsert; i<numPolys; i++)
polyEnd = newPolyEnd;
}
+IPoint GlyphPoints::GetMidpointToPrev(uint16 poly, uint16 pt)
+{
+ uint16 prev = GetPrev(poly, pt);
+
+ int32 x1 = GetX(poly, pt), y1 = GetY(poly, pt);
+ int32 x2 = GetX(poly, prev), y2 = GetY(poly, prev);
+
+ return IPoint((x1 + x2) / 2.0f, (y1 + y2) / 2.0f);
+}
+
+IPoint GlyphPoints::GetMidpointToNext(uint16 poly, uint16 pt)
+{
+ uint16 next = GetNext(poly, pt);
+
+ int32 x1 = GetX(poly, pt), y1 = GetY(poly, pt);
+ int32 x2 = GetX(poly, next), y2 = GetY(poly, next);
+
+ return IPoint((x1 + x2) / 2.0f, (y1 + y2) / 2.0f);
+}
+
+IPoint GlyphPoints::GetPrevPoint(uint16 poly, uint16 pt)
+{
+ uint16 prevPt = GetPrev(poly, pt);
+
+ return IPoint(GetX(poly, prevPt), GetY(poly, prevPt));
+}
+
+IPoint GlyphPoints::GetNextPoint(uint16 poly, uint16 pt)
+{
+ uint16 nextPt = GetNext(poly, pt);
+
+ return IPoint(GetX(poly, nextPt), GetY(poly, nextPt));
+}