|
|
|
@ -92,8 +92,8 @@ |
|
|
|
|
if ( outline->n_contours > 0 ) |
|
|
|
|
first = outline->contours[outline->n_contours - 1]; |
|
|
|
|
|
|
|
|
|
/* if the last point falls on the same location than the first one */ |
|
|
|
|
/* we need to delete it */ |
|
|
|
|
/* if the last point falls on the same location as the first one */ |
|
|
|
|
/* we need to delete it */ |
|
|
|
|
if ( last > first ) |
|
|
|
|
{ |
|
|
|
|
FT_Vector* p1 = outline->points + first; |
|
|
|
@ -215,8 +215,10 @@ |
|
|
|
|
/* check that there is space for a new contour and a new point */ |
|
|
|
|
error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 1 ); |
|
|
|
|
if ( !error ) |
|
|
|
|
{ |
|
|
|
|
/* add new start point */ |
|
|
|
|
error = pfr_glyph_line_to( glyph, to ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return error; |
|
|
|
|
} |
|
|
|
@ -304,8 +306,8 @@ |
|
|
|
|
|
|
|
|
|
glyph->y_control = glyph->x_control + x_count; |
|
|
|
|
|
|
|
|
|
mask = 0; |
|
|
|
|
x = 0; |
|
|
|
|
mask = 0; |
|
|
|
|
x = 0; |
|
|
|
|
|
|
|
|
|
for ( i = 0; i < count; i++ ) |
|
|
|
|
{ |
|
|
|
@ -331,9 +333,9 @@ |
|
|
|
|
mask >>= 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* XXX: for now we ignore the secondary stroke and edge definitions */ |
|
|
|
|
/* since we don't want to support native PFR hinting */ |
|
|
|
|
/* */ |
|
|
|
|
/* XXX: we ignore the secondary stroke and edge definitions */ |
|
|
|
|
/* since we don't support native PFR hinting */ |
|
|
|
|
/* */ |
|
|
|
|
if ( flags & PFR_GLYPH_EXTRA_ITEMS ) |
|
|
|
|
{ |
|
|
|
|
error = pfr_extra_items_skip( &p, limit ); |
|
|
|
@ -366,27 +368,27 @@ |
|
|
|
|
|
|
|
|
|
switch ( format >> 4 ) |
|
|
|
|
{ |
|
|
|
|
case 0: /* end glyph */ |
|
|
|
|
case 0: /* end glyph */ |
|
|
|
|
FT_TRACE6(( "- end glyph" )); |
|
|
|
|
args_count = 0; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 1: /* general line operation */ |
|
|
|
|
case 1: /* general line operation */ |
|
|
|
|
FT_TRACE6(( "- general line" )); |
|
|
|
|
goto Line1; |
|
|
|
|
|
|
|
|
|
case 4: /* move to inside contour */ |
|
|
|
|
case 4: /* move to inside contour */ |
|
|
|
|
FT_TRACE6(( "- move to inside" )); |
|
|
|
|
goto Line1; |
|
|
|
|
|
|
|
|
|
case 5: /* move to outside contour */ |
|
|
|
|
case 5: /* move to outside contour */ |
|
|
|
|
FT_TRACE6(( "- move to outside" )); |
|
|
|
|
Line1: |
|
|
|
|
args_format = format_low; |
|
|
|
|
args_count = 1; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 2: /* horizontal line to */ |
|
|
|
|
case 2: /* horizontal line to */ |
|
|
|
|
FT_TRACE6(( "- horizontal line to cx.%d", format_low )); |
|
|
|
|
if ( format_low >= x_count ) |
|
|
|
|
goto Failure; |
|
|
|
@ -396,7 +398,7 @@ |
|
|
|
|
args_count = 0; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 3: /* vertical line to */ |
|
|
|
|
case 3: /* vertical line to */ |
|
|
|
|
FT_TRACE6(( "- vertical line to cy.%d", format_low )); |
|
|
|
|
if ( format_low >= y_count ) |
|
|
|
|
goto Failure; |
|
|
|
@ -406,19 +408,19 @@ |
|
|
|
|
args_count = 0; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 6: /* horizontal to vertical curve */ |
|
|
|
|
case 6: /* horizontal to vertical curve */ |
|
|
|
|
FT_TRACE6(( "- hv curve " )); |
|
|
|
|
args_format = 0xB8E; |
|
|
|
|
args_count = 3; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 7: /* vertical to horizontal curve */ |
|
|
|
|
case 7: /* vertical to horizontal curve */ |
|
|
|
|
FT_TRACE6(( "- vh curve" )); |
|
|
|
|
args_format = 0xE2B; |
|
|
|
|
args_count = 3; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: /* general curve to */ |
|
|
|
|
default: /* general curve to */ |
|
|
|
|
FT_TRACE6(( "- general curve" )); |
|
|
|
|
args_count = 4; |
|
|
|
|
args_format = format_low; |
|
|
|
@ -439,14 +441,14 @@ |
|
|
|
|
{ |
|
|
|
|
case 0: /* 8-bit index */ |
|
|
|
|
PFR_CHECK( 1 ); |
|
|
|
|
idx = PFR_NEXT_BYTE( p ); |
|
|
|
|
idx = PFR_NEXT_BYTE( p ); |
|
|
|
|
if ( idx >= x_count ) |
|
|
|
|
goto Failure; |
|
|
|
|
cur->x = glyph->x_control[idx]; |
|
|
|
|
FT_TRACE7(( " cx#%d", idx )); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 1: /* 16-bit value */ |
|
|
|
|
case 1: /* 16-bit absolute value */ |
|
|
|
|
PFR_CHECK( 2 ); |
|
|
|
|
cur->x = PFR_NEXT_SHORT( p ); |
|
|
|
|
FT_TRACE7(( " x.%d", cur->x )); |
|
|
|
@ -516,22 +518,22 @@ |
|
|
|
|
/* */ |
|
|
|
|
switch ( format >> 4 ) |
|
|
|
|
{ |
|
|
|
|
case 0: /* end glyph => EXIT */ |
|
|
|
|
case 0: /* end glyph => EXIT */ |
|
|
|
|
pfr_glyph_end( glyph ); |
|
|
|
|
goto Exit; |
|
|
|
|
|
|
|
|
|
case 1: /* line operations */ |
|
|
|
|
case 1: /* line operations */ |
|
|
|
|
case 2: |
|
|
|
|
case 3: |
|
|
|
|
error = pfr_glyph_line_to( glyph, pos ); |
|
|
|
|
goto Test_Error; |
|
|
|
|
|
|
|
|
|
case 4: /* move to inside contour */ |
|
|
|
|
case 5: /* move to outside contour */ |
|
|
|
|
case 4: /* move to inside contour */ |
|
|
|
|
case 5: /* move to outside contour */ |
|
|
|
|
error = pfr_glyph_move_to( glyph, pos ); |
|
|
|
|
goto Test_Error; |
|
|
|
|
|
|
|
|
|
default: /* curve operations */ |
|
|
|
|
default: /* curve operations */ |
|
|
|
|
error = pfr_glyph_curve_to( glyph, pos, pos + 1, pos + 2 ); |
|
|
|
|
|
|
|
|
|
Test_Error: /* test error condition */ |
|
|
|
@ -580,7 +582,8 @@ |
|
|
|
|
if ( flags & PFR_GLYPH_EXTRA_ITEMS ) |
|
|
|
|
{ |
|
|
|
|
error = pfr_extra_items_skip( &p, limit ); |
|
|
|
|
if (error) goto Exit; |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* we can't rely on the FT_GlyphLoader to load sub-glyphs, because */ |
|
|
|
|