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++)
return x[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
}
+int GlyphPoints::GetNextX(uint16 poly, uint16 pt)
+{
+ return GetX(poly, GetNext(poly, pt));
+}
+
int GlyphPoints::GetY(uint16 poly, uint16 pt)
{
if (pt >= GetNumPoints(poly))
return y[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
}
+int GlyphPoints::GetNextY(uint16 poly, uint16 pt)
+{
+ return GetY(poly, GetNext(poly, pt));
+}
+
+IPoint GlyphPoints::GetPoint(uint16 poly, uint16 pt)
+{
+ return IPoint(GetX(poly, pt), GetY(poly, pt));
+}
+
bool GlyphPoints::GetOnCurve(uint16 poly, uint16 pt)
{
if (pt >= GetNumPoints(poly))
return onCurve[pt + (poly == 0 ? 0 : polyEnd[poly - 1] + 1)];
}
+bool GlyphPoints::GetPrevOnCurve(uint16 poly, uint16 pt)
+{
+ return GetOnCurve(poly, GetPrev(poly, pt));
+}
+
+bool GlyphPoints::GetNextOnCurve(uint16 poly, uint16 pt)
+{
+ return GetOnCurve(poly, GetNext(poly, pt));
+}
+
uint16 GlyphPoints::GetPolyEnd(uint16 poly)
{
if (poly >= numPolys)
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));
+}