File tree 1 file changed +6
-28
lines changed
1 file changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,9 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
203
203
/* Step thru the coutours. */
204
204
/* I believe that a contour is a detatched */
205
205
/* set of curves and lines. */
206
- i=j=k=0 ;
207
- while ( i < num_ctr )
206
+ for (i = j = k = 0 ;
207
+ i != NOMOREOUTCTR && i < num_ctr;
208
+ k = nextinctr (i, k), (k == NOMOREINCTR && (i = k = nextoutctr (i))))
208
209
{
209
210
// A TrueType contour consists of on-path and off-path points.
210
211
// Two consecutive on-path points are to be joined with a
@@ -224,24 +225,13 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
224
225
}
225
226
}
226
227
227
- // For any two consecutive off-path points, insert the implied
228
- // on-path point.
229
-
230
228
if (points.size () == 0 ) {
231
- k=nextinctr (i,k);
232
-
233
- if (k==NOMOREINCTR)
234
- {
235
- i=k=nextoutctr (i);
236
- }
237
-
238
- if (i==NOMOREOUTCTR)
239
- {
240
- break ;
241
- }
229
+ // Don't try to access the last element of an empty list
242
230
continue ;
243
231
}
244
232
233
+ // For any two consecutive off-path points, insert the implied
234
+ // on-path point.
245
235
FlaggedPoint prev = points.back ();
246
236
for (std::list<FlaggedPoint>::iterator it = points.begin ();
247
237
it != points.end ();
@@ -296,18 +286,6 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
296
286
p += 2 ;
297
287
}
298
288
}
299
-
300
- k=nextinctr (i,k);
301
-
302
- if (k==NOMOREINCTR)
303
- {
304
- i=k=nextoutctr (i);
305
- }
306
-
307
- if (i==NOMOREOUTCTR)
308
- {
309
- break ;
310
- }
311
289
}
312
290
313
291
/* Now, we can fill the whole thing. */
You can’t perform that action at this time.
0 commit comments