summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/base/ftsynth.c
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2015-03-19 17:34:42 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2015-03-20 13:42:29 +0000
commit2eaf0cf8fd6e7c290497fedb08134a89e7b49b1d (patch)
tree0a4f7bf528e87d0b0a71ce7fccf702b87f4cdec1 /src/3rdparty/freetype/src/base/ftsynth.c
parent77c518a50334d4dcf2476a4f39edc1e3990c7f0b (diff)
Update bundled FreeType to 2.5.5
Removed everything, imported with help of import_from_tarball.sh script, and then added a pre-generated builds/unix/ftconfig.h Task-number: QTBUG-44648 Change-Id: Iea948e41f7761f1580382b3763d04c7a61383382 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.c41
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 )