diff options
author | marha <marha@users.sourceforge.net> | 2011-11-10 15:49:48 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-10 15:49:48 +0100 |
commit | d783adea42f29bd7917929597ca1031b70587e1d (patch) | |
tree | 888ffc3043e659513c1760fdb7bd531810723afa /freetype/src/base | |
parent | ba1993a2eefbd475b13f373a861a401f06584cf8 (diff) | |
download | vcxsrv-d783adea42f29bd7917929597ca1031b70587e1d.tar.gz vcxsrv-d783adea42f29bd7917929597ca1031b70587e1d.tar.bz2 vcxsrv-d783adea42f29bd7917929597ca1031b70587e1d.zip |
Updated to freetype 2.4.7
Diffstat (limited to 'freetype/src/base')
-rw-r--r-- | freetype/src/base/ftbitmap.c | 6 | ||||
-rw-r--r-- | freetype/src/base/ftobjs.c | 87 | ||||
-rw-r--r-- | freetype/src/base/ftstroke.c | 10 |
3 files changed, 94 insertions, 9 deletions
diff --git a/freetype/src/base/ftbitmap.c b/freetype/src/base/ftbitmap.c index 22ec33752..5ef7ac760 100644 --- a/freetype/src/base/ftbitmap.c +++ b/freetype/src/base/ftbitmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility functions for bitmaps (body). */ /* */ -/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2004-2009, 2011 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -417,6 +417,10 @@ target->pitch = source->width + pad; + if ( target->pitch > 0 && + target->rows > FT_ULONG_MAX / target->pitch ) + return FT_Err_Invalid_Argument; + if ( target->rows * target->pitch > old_size && FT_QREALLOC( target->buffer, old_size, target->rows * target->pitch ) ) diff --git a/freetype/src/base/ftobjs.c b/freetype/src/base/ftobjs.c index 5069afb2c..64575af59 100644 --- a/freetype/src/base/ftobjs.c +++ b/freetype/src/base/ftobjs.c @@ -620,7 +620,8 @@ FT_DRIVER_IS_SCALABLE( driver ) && FT_DRIVER_USES_OUTLINES( driver ) && !FT_IS_TRICKY( face ) && - ( ( face->internal->transform_matrix.yx == 0 && + ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) || + ( face->internal->transform_matrix.yx == 0 && face->internal->transform_matrix.xx != 0 ) || ( face->internal->transform_matrix.xx == 0 && face->internal->transform_matrix.yx != 0 ) ) ) @@ -756,11 +757,11 @@ else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { /* apply `standard' transformation if no renderer is available */ - if ( &internal->transform_matrix ) + if ( internal->transform_flags & 1 ) FT_Outline_Transform( &slot->outline, &internal->transform_matrix ); - if ( &internal->transform_delta ) + if ( internal->transform_flags & 2 ) FT_Outline_Translate( &slot->outline, internal->transform_delta.x, internal->transform_delta.y ); @@ -2613,6 +2614,18 @@ metrics->height = bsize->height << 6; metrics->max_advance = bsize->x_ppem; } + + FT_TRACE5(( "FT_Select_Metrics:\n" )); + FT_TRACE5(( " x scale: %d (%f)\n", + metrics->x_scale, metrics->x_scale / 65536.0 )); + FT_TRACE5(( " y scale: %d (%f)\n", + metrics->y_scale, metrics->y_scale / 65536.0 )); + FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 )); + FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 )); + FT_TRACE5(( " height: %f\n", metrics->height / 64.0 )); + FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 )); + FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem )); + FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem )); } @@ -2721,6 +2734,18 @@ metrics->x_scale = 1L << 16; metrics->y_scale = 1L << 16; } + + FT_TRACE5(( "FT_Request_Metrics:\n" )); + FT_TRACE5(( " x scale: %d (%f)\n", + metrics->x_scale, metrics->x_scale / 65536.0 )); + FT_TRACE5(( " y scale: %d (%f)\n", + metrics->y_scale, metrics->y_scale / 65536.0 )); + FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 )); + FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 )); + FT_TRACE5(( " height: %f\n", metrics->height / 64.0 )); + FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 )); + FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem )); + FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem )); } @@ -2742,7 +2767,33 @@ clazz = face->driver->clazz; if ( clazz->select_size ) - return clazz->select_size( face->size, (FT_ULong)strike_index ); + { + FT_Error error; + + + error = clazz->select_size( face->size, (FT_ULong)strike_index ); + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_Size_Metrics* metrics = &face->size->metrics; + + + FT_TRACE5(( "FT_Select_Size (font driver's `select_size'):\n" )); + FT_TRACE5(( " x scale: %d (%f)\n", + metrics->x_scale, metrics->x_scale / 65536.0 )); + FT_TRACE5(( " y scale: %d (%f)\n", + metrics->y_scale, metrics->y_scale / 65536.0 )); + FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 )); + FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 )); + FT_TRACE5(( " height: %f\n", metrics->height / 64.0 )); + FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 )); + FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem )); + FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem )); + } +#endif + + return error; + } FT_Select_Metrics( face, (FT_ULong)strike_index ); @@ -2770,7 +2821,33 @@ clazz = face->driver->clazz; if ( clazz->request_size ) - return clazz->request_size( face->size, req ); + { + FT_Error error; + + + error = clazz->request_size( face->size, req ); + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_Size_Metrics* metrics = &face->size->metrics; + + + FT_TRACE5(( "FT_Request_Size (font driver's `request_size'):\n" )); + FT_TRACE5(( " x scale: %d (%f)\n", + metrics->x_scale, metrics->x_scale / 65536.0 )); + FT_TRACE5(( " y scale: %d (%f)\n", + metrics->y_scale, metrics->y_scale / 65536.0 )); + FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 )); + FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 )); + FT_TRACE5(( " height: %f\n", metrics->height / 64.0 )); + FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 )); + FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem )); + FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem )); + } +#endif + + return error; + } /* * The reason that a driver doesn't have `request_size' defined is diff --git a/freetype/src/base/ftstroke.c b/freetype/src/base/ftstroke.c index 3f24f9ee8..5399efe9d 100644 --- a/freetype/src/base/ftstroke.c +++ b/freetype/src/base/ftstroke.c @@ -2222,9 +2222,13 @@ if ( error ) goto Exit; - error = FT_Stroker_EndSubPath( stroker ); - if ( error ) - goto Exit; + /* don't try to end the path if no segments have been generated */ + if ( !stroker->first_point ) + { + error = FT_Stroker_EndSubPath( stroker ); + if ( error ) + goto Exit; + } first = last + 1; } |