diff options
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftsynth.c')
-rw-r--r-- | src/3rdparty/freetype/src/base/ftsynth.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/3rdparty/freetype/src/base/ftsynth.c b/src/3rdparty/freetype/src/base/ftsynth.c index ba3c633e28..0567bd537a 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, 2010 by */ +/* Copyright 2000-2006, 2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -33,6 +33,7 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_synth + /*************************************************************************/ /*************************************************************************/ /**** ****/ @@ -47,8 +48,13 @@ FT_GlyphSlot_Oblique( FT_GlyphSlot slot ) { FT_Matrix transform; - FT_Outline* outline = &slot->outline; + FT_Outline* outline; + + + if ( !slot ) + return; + outline = &slot->outline; /* only oblique outline glyphs */ if ( slot->format != FT_GLYPH_FORMAT_OUTLINE ) @@ -62,7 +68,7 @@ transform.xx = 0x10000L; transform.yx = 0x00000L; - transform.xy = 0x06000L; + transform.xy = 0x0366AL; transform.yy = 0x10000L; FT_Outline_Transform( outline, &transform ); @@ -72,7 +78,7 @@ /*************************************************************************/ /*************************************************************************/ /**** ****/ - /**** EXPERIMENTAL EMBOLDENING/OUTLINING SUPPORT ****/ + /**** EXPERIMENTAL EMBOLDENING SUPPORT ****/ /**** ****/ /*************************************************************************/ /*************************************************************************/ @@ -83,14 +89,20 @@ FT_EXPORT_DEF( void ) FT_GlyphSlot_Embolden( FT_GlyphSlot slot ) { - FT_Library library = slot->library; - FT_Face face = slot->face; + FT_Library library; + FT_Face face; FT_Error error; FT_Pos xstr, ystr; + if ( !slot ) + return; + + library = slot->library; + face = slot->face; + if ( slot->format != FT_GLYPH_FORMAT_OUTLINE && - slot->format != FT_GLYPH_FORMAT_BITMAP ) + slot->format != FT_GLYPH_FORMAT_BITMAP ) return; /* some reasonable strength */ @@ -99,16 +111,9 @@ ystr = xstr; if ( slot->format == FT_GLYPH_FORMAT_OUTLINE ) - { - /* ignore error */ - (void)FT_Outline_Embolden( &slot->outline, xstr ); + FT_Outline_EmboldenXY( &slot->outline, xstr, ystr ); - /* this is more than enough for most glyphs; if you need accurate */ - /* values, you have to call FT_Outline_Get_CBox */ - xstr = xstr * 2; - ystr = xstr; - } - else if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) + else /* slot->format == FT_GLYPH_FORMAT_BITMAP */ { /* round to full pixels */ xstr &= ~63; @@ -145,11 +150,9 @@ slot->metrics.width += xstr; slot->metrics.height += ystr; - slot->metrics.horiBearingY += ystr; slot->metrics.horiAdvance += xstr; - slot->metrics.vertBearingX -= xstr / 2; - slot->metrics.vertBearingY += ystr; slot->metrics.vertAdvance += ystr; + slot->metrics.horiBearingY += ystr; /* XXX: 16-bit overflow case must be excluded before here */ if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) |