diff options
author | marha <marha@users.sourceforge.net> | 2013-06-21 10:45:51 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-06-21 10:48:19 +0200 |
commit | fa791414601df61d20d860299dba80fdb62565df (patch) | |
tree | eecc4c74bb78dece330009c571ed57d7f1aaede2 /freetype/src/autofit | |
parent | 7f9fb534564d0eb8a62cf444e569a07166e5ee03 (diff) | |
download | vcxsrv-fa791414601df61d20d860299dba80fdb62565df.tar.gz vcxsrv-fa791414601df61d20d860299dba80fdb62565df.tar.bz2 vcxsrv-fa791414601df61d20d860299dba80fdb62565df.zip |
Upgraded freetype to 2.5.0.1
Diffstat (limited to 'freetype/src/autofit')
-rw-r--r-- | freetype/src/autofit/afcjk.c | 22 | ||||
-rw-r--r-- | freetype/src/autofit/afdummy.c | 6 | ||||
-rw-r--r-- | freetype/src/autofit/afglobal.c | 10 | ||||
-rw-r--r-- | freetype/src/autofit/afhints.c | 26 | ||||
-rw-r--r-- | freetype/src/autofit/afindic.c | 4 | ||||
-rw-r--r-- | freetype/src/autofit/aflatin.c | 18 | ||||
-rw-r--r-- | freetype/src/autofit/aflatin2.c | 97 | ||||
-rw-r--r-- | freetype/src/autofit/afloader.c | 10 | ||||
-rw-r--r-- | freetype/src/autofit/afmodule.c | 26 | ||||
-rw-r--r-- | freetype/src/autofit/afpic.c | 4 |
10 files changed, 117 insertions, 106 deletions
diff --git a/freetype/src/autofit/afcjk.c b/freetype/src/autofit/afcjk.c index 38325f6d0..f69a528e3 100644 --- a/freetype/src/autofit/afcjk.c +++ b/freetype/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006-2012 by */ +/* Copyright 2006-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -481,7 +481,8 @@ FT_Bool under_ref = FT_BOOL( shoot < ref ); - if ( (AF_CJK_BLUE_TOP == bb || AF_CJK_BLUE_RIGHT == bb) ^ under_ref ) + if ( ( AF_CJK_BLUE_TOP == bb || + AF_CJK_BLUE_RIGHT == bb ) ^ under_ref ) *blue_shoot = *blue_ref = ( shoot + ref ) / 2; } @@ -566,7 +567,7 @@ FT_Set_Charmap( face, oldmap ); - return AF_Err_Ok; + return FT_Err_Ok; } @@ -702,7 +703,7 @@ { AF_Point pt = seg->first; AF_Point last = seg->last; - AF_Flags f0 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL); + AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL ); AF_Flags f1; @@ -711,7 +712,7 @@ for ( ; pt != last; f0 = f1 ) { pt = pt->next; - f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL); + f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL ); if ( !f0 && !f1 ) break; @@ -721,7 +722,7 @@ } } - return AF_Err_Ok; + return FT_Err_Ok; } @@ -895,7 +896,7 @@ AF_Dimension dim ) { AF_AxisHints axis = &hints->axis[dim]; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Memory memory = hints->memory; AF_CJKAxis laxis = &((AF_CJKMetrics)hints->metrics)->axis[dim]; @@ -965,14 +966,15 @@ /* can make a single edge. */ if ( link ) { - AF_Segment seg1 = edge->first; - AF_Segment link1; + AF_Segment seg1 = edge->first; FT_Pos dist2 = 0; do { - link1 = seg1->link; + AF_Segment link1 = seg1->link; + + if ( link1 ) { dist2 = AF_SEGMENT_DIST( link, link1 ); diff --git a/freetype/src/autofit/afdummy.c b/freetype/src/autofit/afdummy.c index 2258a198a..22944559d 100644 --- a/freetype/src/autofit/afdummy.c +++ b/freetype/src/autofit/afdummy.c @@ -5,7 +5,7 @@ /* Auto-fitter dummy routines to be used if no hinting should be */ /* performed (body). */ /* */ -/* Copyright 2003-2005, 2011 by */ +/* Copyright 2003-2005, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -28,7 +28,7 @@ { af_glyph_hints_rescale( hints, metrics ); - return AF_Err_Ok; + return FT_Err_Ok; } @@ -39,7 +39,7 @@ FT_UNUSED( hints ); FT_UNUSED( outline ); - return AF_Err_Ok; + return FT_Err_Ok; } diff --git a/freetype/src/autofit/afglobal.c b/freetype/src/autofit/afglobal.c index 3c1e837ed..3e4146575 100644 --- a/freetype/src/autofit/afglobal.c +++ b/freetype/src/autofit/afglobal.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter routines to compute global hinting values (body). */ /* */ -/* Copyright 2003-2012 by */ +/* Copyright 2003-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -55,7 +55,7 @@ static FT_Error af_face_globals_compute_script_coverage( AF_FaceGlobals globals ) { - FT_Error error = AF_Err_Ok; + FT_Error error; FT_Face face = globals->face; FT_CharMap old_charmap = face->charmap; FT_Byte* gscripts = globals->glyph_scripts; @@ -75,7 +75,7 @@ * Ignore this error; we simply use the fallback script. * XXX: Shouldn't we rather disable hinting? */ - error = AF_Err_Ok; + error = FT_Err_Ok; goto Exit; } @@ -237,12 +237,12 @@ FT_UInt script = options & 15; const FT_Offset script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) / sizeof ( AF_SCRIPT_CLASSES_GET[0] ); - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; if ( gindex >= (FT_ULong)globals->glyph_count ) { - error = AF_Err_Invalid_Argument; + error = FT_THROW( Invalid_Argument ); goto Exit; } diff --git a/freetype/src/autofit/afhints.c b/freetype/src/autofit/afhints.c index 8aca8e7ba..e8defaa88 100644 --- a/freetype/src/autofit/afhints.c +++ b/freetype/src/autofit/afhints.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003-2007, 2009-2012 by */ +/* Copyright 2003-2007, 2009-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -39,7 +39,7 @@ FT_Memory memory, AF_Segment *asegment ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Segment segment = NULL; @@ -52,7 +52,7 @@ if ( old_max >= big_max ) { - error = AF_Err_Out_Of_Memory; + error = FT_THROW( Out_Of_Memory ); goto Exit; } @@ -83,7 +83,7 @@ FT_Memory memory, AF_Edge *anedge ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Edge edge = NULL; AF_Edge edges; @@ -97,7 +97,7 @@ if ( old_max >= big_max ) { - error = AF_Err_Out_Of_Memory; + error = FT_THROW( Out_Of_Memory ); goto Exit; } @@ -265,7 +265,7 @@ FT_TRACE7(( "Table of %s segments:\n", dimension == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); - if (axis->num_segments) + if ( axis->num_segments ) FT_TRACE7(( " [ index | pos | dir | from" " | to | link | serif | edge" " | height | extra | flags ]\n" )); @@ -316,7 +316,7 @@ axis = &hints->axis[dim]; *num_segments = axis->num_segments; - return AF_Err_Ok; + return FT_Err_Ok; } #ifdef __cplusplus } @@ -340,20 +340,20 @@ if ( !offset ) - return AF_Err_Invalid_Argument; + return FT_THROW( Invalid_Argument ); dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT; axis = &hints->axis[dim]; if ( idx < 0 || idx >= axis->num_segments ) - return AF_Err_Invalid_Argument; + return FT_THROW( Invalid_Argument ); seg = &axis->segments[idx]; - *offset = (dim == AF_DIMENSION_HORZ) ? seg->first->ox - : seg->first->oy; + *offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox + : seg->first->oy; - return AF_Err_Ok; + return FT_Err_Ok; } #ifdef __cplusplus } @@ -593,7 +593,7 @@ af_glyph_hints_reload( AF_GlyphHints hints, FT_Outline* outline ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Point points; FT_UInt old_max, new_max; FT_Fixed x_scale = hints->x_scale; diff --git a/freetype/src/autofit/afindic.c b/freetype/src/autofit/afindic.c index 70de70ba9..8c2497259 100644 --- a/freetype/src/autofit/afindic.c +++ b/freetype/src/autofit/afindic.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for Indic scripts (body). */ /* */ -/* Copyright 2007, 2011, 2012 by */ +/* Copyright 2007, 2011-2013 by */ /* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -56,7 +56,7 @@ FT_Set_Charmap( face, oldmap ); - return AF_Err_Ok; + return FT_Err_Ok; } diff --git a/freetype/src/autofit/aflatin.c b/freetype/src/autofit/aflatin.c index 8ebd49681..ef0157a13 100644 --- a/freetype/src/autofit/aflatin.c +++ b/freetype/src/autofit/aflatin.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003-2012 by */ +/* Copyright 2003-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -561,7 +561,7 @@ } FT_Set_Charmap( face, oldmap ); - return AF_Err_Ok; + return FT_Err_Ok; } @@ -743,7 +743,7 @@ if ( delta2 < 32 ) delta2 = 0; - else if ( delta < 48 ) + else if ( delta2 < 48 ) delta2 = 32; else delta2 = 64; @@ -795,7 +795,7 @@ { AF_AxisHints axis = &hints->axis[dim]; FT_Memory memory = hints->memory; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Segment segment = NULL; AF_SegmentRec seg0; AF_Point* contour = hints->contours; @@ -1107,7 +1107,7 @@ AF_Dimension dim ) { AF_AxisHints axis = &hints->axis[dim]; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Memory memory = hints->memory; AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim]; @@ -1583,7 +1583,7 @@ hints->scaler_flags = scaler_flags; hints->other_flags = other_flags; - return AF_Err_Ok; + return FT_Err_Ok; } @@ -1787,7 +1787,7 @@ if ( delta < 0 ) delta = -delta; - if (delta >= 16) + if ( delta >= 16 ) { dist = org_dist; if ( dist < 48 ) @@ -1914,7 +1914,7 @@ continue; #ifdef FT_DEBUG_LEVEL_TRACE - if (!anchor) + if ( !anchor ) FT_TRACE5(( " BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f," " was %.2f (anchor=edge %d)\n", edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0, @@ -2080,7 +2080,7 @@ cur_pos1 = FT_PIX_ROUND( org_center ); - if (cur_len <= 64 ) + if ( cur_len <= 64 ) { u_off = 32; d_off = 32; diff --git a/freetype/src/autofit/aflatin2.c b/freetype/src/autofit/aflatin2.c index 40a5ffd6a..b1e9658d5 100644 --- a/freetype/src/autofit/aflatin2.c +++ b/freetype/src/autofit/aflatin2.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003-2012 by */ +/* Copyright 2003-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -475,7 +475,7 @@ af_latin2_metrics_init( AF_LatinMetrics metrics, FT_Face face ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; FT_CharMap oldmap = face->charmap; FT_UInt ee; @@ -507,7 +507,7 @@ } FT_Set_Charmap( face, oldmap ); - return AF_Err_Ok; + return FT_Err_Ok; } @@ -708,7 +708,7 @@ { AF_AxisHints axis = &hints->axis[dim]; FT_Memory memory = hints->memory; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Segment segment = NULL; AF_SegmentRec seg0; AF_Point* contour = hints->contours; @@ -824,17 +824,17 @@ segment->dir = first->out_dir; segment->first = first; segment->last = point; - segment->pos = (FT_Short)(( min_u + max_u ) >> 1); + segment->pos = (FT_Short)( ( min_u + max_u ) >> 1 ); segment->min_coord = (FT_Short) min_v; segment->max_coord = (FT_Short) max_v; - segment->height = (FT_Short)(max_v - min_v); + segment->height = (FT_Short)( max_v - min_v ); /* a segment is round if it doesn't have successive */ /* on-curve points. */ { AF_Point pt = first; AF_Point last = point; - AF_Flags f0 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL); + AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL ); AF_Flags f1; @@ -843,7 +843,7 @@ for ( ; pt != last; f0 = f1 ) { pt = pt->next; - f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL); + f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL ); if ( !f0 && !f1 ) break; @@ -860,7 +860,7 @@ break; /* jump to the start of the next segment, if any */ - while ( FT_ABS(point->out_dir) != major_dir ) + while ( FT_ABS( point->out_dir ) != major_dir ) { point = point->next; @@ -928,16 +928,17 @@ FT_UInt count = axis->num_segments; FT_UInt ii, jj; - for (ii = 0; ii < count; ii++) + for ( ii = 0; ii < count; ii++ ) { if ( segments[ii].dir > 0 ) { - for (jj = ii+1; jj < count; jj++) + for ( jj = ii + 1; jj < count; jj++ ) { if ( segments[jj].dir < 0 ) { AF_SegmentRec tmp; + tmp = segments[ii]; segments[ii] = segments[jj]; segments[jj] = tmp; @@ -1064,7 +1065,7 @@ AF_Dimension dim ) { AF_AxisHints axis = &hints->axis[dim]; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; FT_Memory memory = hints->memory; AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim]; @@ -1098,7 +1099,7 @@ if ( dim == AF_DIMENSION_HORZ ) { if ( laxis->width_count > 0 ) - segment_length_threshold = (laxis->standard_width * 10 ) >> 4; + segment_length_threshold = ( laxis->standard_width * 10 ) >> 4; else segment_length_threshold = FT_DivFix( 64, hints->y_scale ); } @@ -1144,10 +1145,11 @@ { FT_Pos dist = seg->serif->pos - seg->pos; - if (dist < 0) + + if ( dist < 0 ) dist = -dist; - if (dist >= laxis->standard_width >> 1) + if ( dist >= laxis->standard_width >> 1 ) { /* unlink this serif, it is too distant from its reference stem */ seg->serif = NULL; @@ -1445,7 +1447,7 @@ compare = &blue->ref; dist = edge->fpos - compare->org; - if (dist < 0) + if ( dist < 0 ) dist = -dist; dist = FT_MulFix( dist, scale ); @@ -1549,8 +1551,8 @@ * In `light' hinting mode we disable horizontal hinting completely. * We also do it if the face is italic. */ - if ( mode == FT_RENDER_MODE_LIGHT || - (face->style_flags & FT_STYLE_FLAG_ITALIC) != 0 ) + if ( mode == FT_RENDER_MODE_LIGHT || + ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 ) scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL; hints->scaler_flags = scaler_flags; @@ -1631,8 +1633,8 @@ FT_Int sign = 0; FT_Int vertical = ( dim == AF_DIMENSION_VERT ); + FT_UNUSED( base_flags ); - FT_UNUSED(base_flags); if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) || axis->extra_light ) @@ -1762,7 +1764,7 @@ if ( delta < 0 ) delta = -delta; - if (delta >= 16) + if ( delta >= 16 ) { dist = org_dist; if ( dist < 48 ) @@ -1816,7 +1818,7 @@ { FT_UNUSED( hints ); - serif->pos = base->pos + (serif->opos - base->opos); + serif->pos = base->pos + ( serif->opos - base->opos ); } @@ -1898,9 +1900,10 @@ { anchor = edge; - anchor_drift = (anchor->pos - anchor->opos); - if (edge2) - anchor_drift = (anchor_drift + (edge2->pos - edge2->opos)) >> 1; + anchor_drift = ( anchor->pos - anchor->opos ); + if ( edge2 ) + anchor_drift = ( anchor_drift + + ( edge2->pos - edge2->opos ) ) >> 1; } } } @@ -1992,8 +1995,8 @@ edge2->flags |= AF_EDGE_DONE; - anchor_drift = ( (anchor->pos - anchor->opos) + - (edge2->pos - edge2->opos)) >> 1; + anchor_drift = ( ( anchor->pos - anchor->opos ) + + ( edge2->pos - edge2->opos ) ) >> 1; FT_TRACE5(( "DRIFT: %.2f\n", anchor_drift/64.0 )); } @@ -2012,8 +2015,8 @@ (AF_Edge_Flags)edge->flags, (AF_Edge_Flags)edge2->flags ); - org_left = org_pos + ((org_len - cur_len) >> 1); - org_right = org_pos + ((org_len + cur_len) >> 1); + org_left = org_pos + ( ( org_len - cur_len ) >> 1 ); + org_right = org_pos + ( ( org_len + cur_len ) >> 1 ); FT_TRACE5(( "ALIGN: left=%.2f right=%.2f ", org_left / 64.0, org_right / 64.0 )); @@ -2041,13 +2044,13 @@ } /* if the span is within a single pixel, don't touch it */ - if ( FT_PIX_FLOOR(org_left) == FT_PIX_CEIL(org_right) ) + if ( FT_PIX_FLOOR( org_left ) == FT_PIX_CEIL( org_right ) ) { FT_TRACE5(( "single pixel stem\n" )); goto AlignStem; } - if (cur_len <= 96) + if ( cur_len <= 96 ) { /* we want to avoid the absolute worst case which is * when the left and right edges of the span each represent @@ -2055,43 +2058,43 @@ * to 25/75%, since this is much more pleasant to the eye with * very acceptable distortion */ - FT_Pos frac_left = (org_left) & 63; - FT_Pos frac_right = (org_right) & 63; + FT_Pos frac_left = org_left & 63; + FT_Pos frac_right = org_right & 63; if ( frac_left >= 22 && frac_left <= 42 && frac_right >= 22 && frac_right <= 42 ) { org = frac_left; - fit = (org <= 32) ? 16 : 48; - delta = FT_ABS(fit - org); + fit = ( org <= 32 ) ? 16 : 48; + delta = FT_ABS( fit - org ); displacements[count] = fit - org; scores[count++] = delta; - FT_TRACE5(( "dispA=%.2f (%d) ", (fit - org) / 64.0, delta )); + FT_TRACE5(( "dispA=%.2f (%d) ", ( fit - org ) / 64.0, delta )); org = frac_right; - fit = (org <= 32) ? 16 : 48; - delta = FT_ABS(fit - org); + fit = ( org <= 32 ) ? 16 : 48; + delta = FT_ABS( fit - org ); displacements[count] = fit - org; scores[count++] = delta; - FT_TRACE5(( "dispB=%.2f (%d) ", (fit - org) / 64.0, delta )); + FT_TRACE5(( "dispB=%.2f (%d) ", ( fit - org ) / 64.0, delta )); } } /* snapping the left edge to the grid */ org = org_left; - fit = FT_PIX_ROUND(org); - delta = FT_ABS(fit - org); + fit = FT_PIX_ROUND( org ); + delta = FT_ABS( fit - org ); displacements[count] = fit - org; scores[count++] = delta; - FT_TRACE5(( "dispC=%.2f (%d) ", (fit - org) / 64.0, delta )); + FT_TRACE5(( "dispC=%.2f (%d) ", ( fit - org ) / 64.0, delta )); /* snapping the right edge to the grid */ org = org_right; - fit = FT_PIX_ROUND(org); - delta = FT_ABS(fit - org); + fit = FT_PIX_ROUND( org ); + delta = FT_ABS( fit - org ); displacements[count] = fit - org; scores[count++] = delta; - FT_TRACE5(( "dispD=%.2f (%d) ", (fit - org) / 64.0, delta )); + FT_TRACE5(( "dispD=%.2f (%d) ", ( fit - org ) / 64.0, delta )); /* now find the best displacement */ { @@ -2099,9 +2102,9 @@ FT_Pos best_disp = displacements[0]; FT_UInt nn; - for (nn = 1; nn < count; nn++) + for ( nn = 1; nn < count; nn++ ) { - if (scores[nn] < best_score) + if ( scores[nn] < best_score ) { best_score = scores[nn]; best_disp = displacements[nn]; @@ -2114,7 +2117,7 @@ } AlignStem: - edge->pos = cur_center - (cur_len >> 1); + edge->pos = cur_center - ( cur_len >> 1 ); edge2->pos = edge->pos + cur_len; FT_TRACE5(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)" diff --git a/freetype/src/autofit/afloader.c b/freetype/src/autofit/afloader.c index f280beda2..17a6fb7c3 100644 --- a/freetype/src/autofit/afloader.c +++ b/freetype/src/autofit/afloader.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter glyph loading routines (body). */ /* */ -/* Copyright 2003-2009, 2011-2012 by */ +/* Copyright 2003-2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -48,7 +48,7 @@ af_loader_reset( AF_Module module, FT_Face face ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Loader loader = module->loader; @@ -349,7 +349,7 @@ if ( start_point + k >= num_base_points || l >= (FT_UInt)num_new_points ) { - error = AF_Err_Invalid_Composite; + error = FT_THROW( Invalid_Composite ); goto Exit; } @@ -387,7 +387,7 @@ default: /* we don't support other formats (yet?) */ - error = AF_Err_Unimplemented_Feature; + error = FT_THROW( Unimplemented_Feature ); } Hint_Metrics: @@ -502,7 +502,7 @@ if ( !size ) - return AF_Err_Invalid_Argument; + return FT_THROW( Invalid_Argument ); FT_ZERO( &scaler ); diff --git a/freetype/src/autofit/afmodule.c b/freetype/src/autofit/afmodule.c index f46cff9ec..b1bb5ee0e 100644 --- a/freetype/src/autofit/afmodule.c +++ b/freetype/src/autofit/afmodule.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module implementation (body). */ /* */ -/* Copyright 2003-2006, 2009, 2011-2012 by */ +/* Copyright 2003-2006, 2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -50,12 +50,12 @@ AF_FaceGlobals* aglobals, AF_Module module ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_FaceGlobals globals; if ( !face ) - return AF_Err_Invalid_Argument; + return FT_THROW( Invalid_Argument ); globals = (AF_FaceGlobals)face->autohint.data; if ( !globals ) @@ -84,7 +84,7 @@ const char* property_name, const void* value ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Module module = (AF_Module)ft_module; @@ -110,9 +110,9 @@ return error; } - FT_TRACE0(( "af_property_get: missing property `%s'\n", + FT_TRACE0(( "af_property_set: missing property `%s'\n", property_name )); - return AF_Err_Missing_Property; + return FT_THROW( Missing_Property ); } @@ -121,7 +121,7 @@ const char* property_name, void* value ) { - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AF_Module module = (AF_Module)ft_module; FT_UInt fallback_script = module->fallback_script; @@ -163,7 +163,7 @@ FT_TRACE0(( "af_property_get: missing property `%s'\n", property_name )); - return AF_Err_Missing_Property; + return FT_THROW( Missing_Property ); } @@ -201,8 +201,11 @@ FT_CALLBACK_DEF( FT_Error ) - af_autofitter_init( AF_Module module ) + af_autofitter_init( FT_Module ft_module ) /* AF_Module */ { + AF_Module module = (AF_Module)ft_module; + + module->fallback_script = AF_SCRIPT_FALLBACK; return af_loader_init( module ); @@ -210,8 +213,11 @@ FT_CALLBACK_DEF( void ) - af_autofitter_done( AF_Module module ) + af_autofitter_done( FT_Module ft_module ) /* AF_Module */ { + AF_Module module = (AF_Module)ft_module; + + af_loader_done( module ); } diff --git a/freetype/src/autofit/afpic.c b/freetype/src/autofit/afpic.c index e6022f930..45e1448c0 100644 --- a/freetype/src/autofit/afpic.c +++ b/freetype/src/autofit/afpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009-2012 by */ +/* Copyright 2009-2013 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -80,7 +80,7 @@ { FT_PIC_Container* pic_container = &library->pic_container; FT_UInt ss; - FT_Error error = AF_Err_Ok; + FT_Error error = FT_Err_Ok; AFModulePIC* container = NULL; FT_Memory memory = library->memory; |