} while (done_anything);
}
-static vec cur;
-
static void
-emit_contour(point *p0)
+emit_contour(point *p0, vec *cur)
{
point *p = p0, *p1;
int stacksize = 0;
do {
stacksize += 2;
printf(" %g %g %s\n",
- (double)(p->v.x - cur.x) / XSCALE,
- (double)(p->v.y - cur.y) / YSCALE,
+ (double)(p->v.x - cur->x) / XSCALE,
+ (double)(p->v.y - cur->y) / YSCALE,
p == p0 ? "rmoveto" : stacksize >= 48 ? "rlineto" : "");
stacksize %= 48;
- cur = p->v;
+ *cur = p->v;
p1 = p->next;
p->prev = p->next = NULL;
p = p1;
{
int i, pass;
point *p;
+ struct vec cur = { 0, DESCENT * YPIX };
- cur.x = 0;
- cur.y = DESCENT * YPIX;
/*
* On the first pass, emit open contours (if there are any).
* On the second pass, emit all remaining contours.
for (i = 0; i < nextpoint; i++) {
p = &points[i];
if (p->next && (!p->prev || pass == 1))
- emit_contour(p);
+ emit_contour(p, &cur);
}
}
printf("endchar\n");