diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-19 17:34:42 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2015-03-20 13:42:29 +0000 |
commit | 2eaf0cf8fd6e7c290497fedb08134a89e7b49b1d (patch) | |
tree | 0a4f7bf528e87d0b0a71ce7fccf702b87f4cdec1 /src/3rdparty/freetype/src/pshinter/pshalgo.c | |
parent | 77c518a50334d4dcf2476a4f39edc1e3990c7f0b (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/pshinter/pshalgo.c')
-rw-r--r-- | src/3rdparty/freetype/src/pshinter/pshalgo.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/3rdparty/freetype/src/pshinter/pshalgo.c b/src/3rdparty/freetype/src/pshinter/pshalgo.c index 417dcee547..644c76d101 100644 --- a/src/3rdparty/freetype/src/pshinter/pshalgo.c +++ b/src/3rdparty/freetype/src/pshinter/pshalgo.c @@ -4,7 +4,7 @@ /* */ /* PostScript hinting algorithm (body). */ /* */ -/* Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ +/* Copyright 2001-2010, 2012-2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -401,13 +401,13 @@ FT_Fixed delta, FT_Int dimension ) { - PSH_Hint hint; - FT_UInt count; + FT_UInt count; for ( count = 0; count < table->max_hints; count++ ) { - hint = table->hints + count; + PSH_Hint hint = table->hints + count; + hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta; hint->cur_len = FT_MulFix( hint->org_len, scale ); @@ -562,7 +562,7 @@ else if ( len > 0 ) { /* This is a very small stem; we simply align it to the - * pixel grid, trying to find the minimal displacement. + * pixel grid, trying to find the minimum displacement. * * left = pos * right = pos + len @@ -1161,8 +1161,8 @@ int result = PSH_DIR_NONE; - ax = ( dx >= 0 ) ? dx : -dx; - ay = ( dy >= 0 ) ? dy : -dy; + ax = FT_ABS( dx ); + ay = FT_ABS( dy ); if ( ay * 12 < ax ) { @@ -1406,7 +1406,6 @@ point = first; before = point; - after = point; do { @@ -1690,7 +1689,10 @@ /* process secondary hints to `selected' points */ if ( num_masks > 1 && glyph->num_points > 0 ) { - first = mask->end_point; + /* the `endchar' op can reduce the number of points */ + first = mask->end_point > glyph->num_points + ? glyph->num_points + : mask->end_point; mask++; for ( ; num_masks > 1; num_masks--, mask++ ) { @@ -1698,7 +1700,9 @@ FT_Int count; - next = mask->end_point; + next = mask->end_point > glyph->num_points + ? glyph->num_points + : mask->end_point; count = next - first; if ( count > 0 ) { @@ -1856,12 +1860,10 @@ point->cur_u = hint->cur_pos + hint->cur_len + FT_MulFix( delta - hint->org_len, scale ); - else if ( hint->org_len > 0 ) + else /* hint->org_len > 0 */ point->cur_u = hint->cur_pos + FT_MulDiv( delta, hint->cur_len, hint->org_len ); - else - point->cur_u = hint->cur_pos; } psh_point_set_fitted( point ); } @@ -2076,8 +2078,6 @@ start = first; do { - point = first; - /* skip consecutive fitted points */ for (;;) { @@ -2190,7 +2190,7 @@ /* something to do? */ if ( outline->n_points == 0 || outline->n_contours == 0 ) - return PSH_Err_Ok; + return FT_Err_Ok; #ifdef DEBUG_HINTER |