OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* cf2font.c */ | 3 /* cf2font.c */ |
4 /* */ | 4 /* */ |
5 /* Adobe's code for font instances (body). */ | 5 /* Adobe's code for font instances (body). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2007-2013 Adobe Systems Incorporated. */ | 7 /* Copyright 2007-2013 Adobe Systems Incorporated. */ |
8 /* */ | 8 /* */ |
9 /* This software, and all works of authorship, whether in source or */ | 9 /* This software, and all works of authorship, whether in source or */ |
10 /* object code form as indicated by the copyright notice(s) included */ | 10 /* object code form as indicated by the copyright notice(s) included */ |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 /* equivalent to AdobeGetOutline */ | 321 /* equivalent to AdobeGetOutline */ |
322 FT_LOCAL_DEF( FT_Error ) | 322 FT_LOCAL_DEF( FT_Error ) |
323 cf2_getGlyphOutline( CF2_Font font, | 323 cf2_getGlyphOutline( CF2_Font font, |
324 CF2_Buffer charstring, | 324 CF2_Buffer charstring, |
325 const CF2_Matrix* transform, | 325 const CF2_Matrix* transform, |
326 CF2_F16Dot16* glyphWidth ) | 326 CF2_F16Dot16* glyphWidth ) |
327 { | 327 { |
328 FT_Error lastError = FT_Err_Ok; | 328 FT_Error lastError = FT_Err_Ok; |
329 | 329 |
330 FT_Vector translation; | 330 FT_Vector translation; |
331 int refCount = 0; | |
332 | 331 |
333 #if 0 | 332 #if 0 |
334 FT_Vector advancePoint; | 333 FT_Vector advancePoint; |
335 #endif | 334 #endif |
336 | 335 |
337 CF2_Fixed advWidth = 0; | 336 CF2_Fixed advWidth = 0; |
338 FT_Bool needWinding; | 337 FT_Bool needWinding; |
339 | 338 |
340 | 339 |
341 /* Note: use both integer and fraction for outlines. This allows bbox */ | 340 /* Note: use both integer and fraction for outlines. This allows bbox */ |
342 /* to come out directly. */ | 341 /* to come out directly. */ |
343 | 342 |
344 translation.x = transform->tx; | 343 translation.x = transform->tx; |
345 translation.y = transform->ty; | 344 translation.y = transform->ty; |
346 | 345 |
347 /* set up values based on transform */ | 346 /* set up values based on transform */ |
348 cf2_font_setup( font, transform ); | 347 cf2_font_setup( font, transform ); |
349 if ( font->error ) | 348 if ( font->error ) |
350 goto exit; /* setup encountered an error */ | 349 goto exit; /* setup encountered an error */ |
351 | 350 |
352 /* reset darken direction */ | 351 /* reset darken direction */ |
353 font->reverseWinding = FALSE; | 352 font->reverseWinding = FALSE; |
354 | 353 |
355 /* winding order only affects darkening */ | 354 /* winding order only affects darkening */ |
356 needWinding = font->darkened; | 355 needWinding = font->darkened; |
357 | 356 |
358 while ( refCount++ < 1024) | 357 while ( 1 ) |
359 { | 358 { |
360 /* reset output buffer */ | 359 /* reset output buffer */ |
361 cf2_outline_reset( &font->outline ); | 360 cf2_outline_reset( &font->outline ); |
362 | 361 |
363 /* build the outline, passing the full translation */ | 362 /* build the outline, passing the full translation */ |
364 cf2_interpT2CharString( font, | 363 cf2_interpT2CharString( font, |
365 charstring, | 364 charstring, |
366 (CF2_OutlineCallbacks)&font->outline, | 365 (CF2_OutlineCallbacks)&font->outline, |
367 &translation, | 366 &translation, |
368 FALSE, | 367 FALSE, |
(...skipping 26 matching lines...) Expand all Loading... |
395 *glyphWidth = advWidth; | 394 *glyphWidth = advWidth; |
396 | 395 |
397 /* free resources and collect errors from objects we've used */ | 396 /* free resources and collect errors from objects we've used */ |
398 cf2_setError( &font->error, lastError ); | 397 cf2_setError( &font->error, lastError ); |
399 | 398 |
400 return font->error; | 399 return font->error; |
401 } | 400 } |
402 | 401 |
403 | 402 |
404 /* END */ | 403 /* END */ |
OLD | NEW |