diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2013-03-26 08:57:05 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-01 12:03:55 +0200 |
commit | 6845a4fb0147117e8517d66f18792ca7acdbe06e (patch) | |
tree | 68e35417b79989a7af8a4ea8c0d282b84dbe0a6e /src/3rdparty/freetype/src/base/ftsynth.c | |
parent | 0fcadcca3d0842354de07ffaa8c622e607aab22c (diff) |
Update bundled FreeType sources to 2.3.12
Most important changes:
* SFNT cmap 13 table format support;
* fixed glitches when rasterizing stretched TTF (xsize!=ysize);
* various fixes in Type1, CFF, and PCF drivers
Change-Id: Ib9e2210ffbd0daa2fdbf518ea87f4be502de6b48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftsynth.c')
-rw-r--r-- | src/3rdparty/freetype/src/base/ftsynth.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/3rdparty/freetype/src/base/ftsynth.c b/src/3rdparty/freetype/src/base/ftsynth.c index 443d272602..ba3c633e28 100644 --- a/src/3rdparty/freetype/src/base/ftsynth.c +++ b/src/3rdparty/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,12 +18,22 @@ #include <ft2build.h> #include FT_SYNTHESIS_H +#include FT_INTERNAL_DEBUG_H #include FT_INTERNAL_OBJECTS_H #include FT_OUTLINE_H #include FT_BITMAP_H /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_synth + + /*************************************************************************/ /*************************************************************************/ /**** ****/ /**** EXPERIMENTAL OBLIQUING SUPPORT ****/ @@ -90,8 +100,8 @@ if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) { - error = FT_Outline_Embolden( &slot->outline, xstr ); /* ignore error */ + (void)FT_Outline_Embolden( &slot->outline, xstr ); /* this is more than enough for most glyphs; if you need accurate */ /* values, you have to call FT_Outline_Get_CBox */ @@ -106,6 +116,18 @@ xstr = 1 << 6; ystr &= ~63; + /* + * XXX: overflow check for 16-bit system, for compatibility + * with FT_GlyphSlot_Embolden() since freetype-2.1.10. + * unfortunately, this function return no informations + * about the cause of error. + */ + if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN ) + { + FT_TRACE1(( "FT_GlyphSlot_Embolden:" )); + FT_TRACE1(( "too strong embolding parameter ystr=%d\n", ystr )); + return; + } error = FT_GlyphSlot_Own_Bitmap( slot ); if ( error ) return; @@ -129,8 +151,9 @@ slot->metrics.vertBearingY += ystr; slot->metrics.vertAdvance += ystr; + /* XXX: 16-bit overflow case must be excluded before here */ if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) - slot->bitmap_top += ystr >> 6; + slot->bitmap_top += (FT_Int)( ystr >> 6 ); } |