summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/pfr/pfrgload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/pfr/pfrgload.c')
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrgload.c67
1 files changed, 37 insertions, 30 deletions
diff --git a/src/3rdparty/freetype/src/pfr/pfrgload.c b/src/3rdparty/freetype/src/pfr/pfrgload.c
index 88df06a03d..b7990196b6 100644
--- a/src/3rdparty/freetype/src/pfr/pfrgload.c
+++ b/src/3rdparty/freetype/src/pfr/pfrgload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (body). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -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,10 +333,10 @@
mask >>= 1;
}
- /* XXX: for now we ignore the secondary stroke and edge definitions */
- /* since we don't want to support native PFR hinting */
- /* */
- if ( flags & PFR_GLYPH_EXTRA_ITEMS )
+ /* XXX: we ignore the secondary stroke and edge definitions */
+ /* since we don't support native PFR hinting */
+ /* */
+ if ( flags & PFR_GLYPH_SINGLE_EXTRA_ITEMS )
{
error = pfr_extra_items_skip( &p, limit );
if ( error )
@@ -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 */
@@ -577,10 +579,11 @@
/* ignore extra items when present */
/* */
- if ( flags & PFR_GLYPH_EXTRA_ITEMS )
+ if ( flags & PFR_GLYPH_COMPOUND_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 */
@@ -753,8 +756,10 @@
count = glyph->num_subs - old_count;
- FT_TRACE4(( "compound glyph with %d elements (offset %lu):\n",
- count, offset ));
+ FT_TRACE4(( "compound glyph with %d element%s (offset %lu):\n",
+ count,
+ count == 1 ? "" : "s",
+ offset ));
/* now, load each individual glyph */
for ( n = 0; n < count; n++ )
@@ -807,7 +812,9 @@
/* proceed to next sub-glyph */
}
- FT_TRACE4(( "end compound glyph with %d elements\n", count ));
+ FT_TRACE4(( "end compound glyph with %d element%s\n",
+ count,
+ count == 1 ? "" : "s" ));
}
else
{