@@ -260,30 +260,33 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
260
260
points.push_back (points.front ());
261
261
}
262
262
263
- // For output, a vector is more convenient than a list.
264
- std::vector<FlaggedPoint> points_v (points.begin (), points.end ());
265
263
// The first point
266
264
stack (stream, 3 );
267
- PSMoveto (stream, points_v .front ().x , points_v .front ().y );
265
+ PSMoveto (stream, points .front ().x , points .front ().y );
268
266
269
267
// Step through the remaining points
270
- for (size_t p = 1 ; p < points_v.size (); )
268
+ std::list<FlaggedPoint>::const_iterator it = points.begin ();
269
+ for (it++; it != points.end (); /* incremented inside */ )
271
270
{
272
- const FlaggedPoint& point = points_v. at (p) ;
271
+ const FlaggedPoint& point = *it ;
273
272
if (point.flag == ON_PATH)
274
273
{
275
274
stack (stream, 3 );
276
275
PSLineto (stream, point.x , point.y );
277
- p ++;
276
+ it ++;
278
277
} else {
279
- assert (points_v.at (p-1 ).flag == ON_PATH);
280
- assert (points_v.at (p+1 ).flag == ON_PATH);
278
+ std::list<FlaggedPoint>::const_iterator prev = it, next = it;
279
+ prev--;
280
+ next++;
281
+ assert (prev->flag == ON_PATH);
282
+ assert (next->flag == ON_PATH);
281
283
stack (stream, 7 );
282
284
PSCurveto (stream,
283
- points_v. at (p- 1 ). x , points_v. at (p- 1 ). y ,
285
+ prev-> x , prev-> y ,
284
286
point.x , point.y ,
285
- points_v.at (p+1 ).x , points_v.at (p+1 ).y );
286
- p += 2 ;
287
+ next->x , next->y );
288
+ it++;
289
+ it++;
287
290
}
288
291
}
289
292
}
0 commit comments