aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/autofit
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-08-06 11:48:36 +0000
committermarha <marha@users.sourceforge.net>2010-08-06 11:48:36 +0000
commit20ff8ddf2d9bb41050d10bbc75d61b9161880c7c (patch)
tree22566fcd9663b2baa565cd0c64eaa662d6ba03ee /freetype/src/autofit
parentc29011f2831315d3da9c4727c1e626d80520b97a (diff)
parent6849d83857b4e470a44ad8b6aa5cfb283fd64c89 (diff)
downloadvcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.gz
vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.bz2
vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.zip
svn merge ^/branches/released .
Diffstat (limited to 'freetype/src/autofit')
-rw-r--r--freetype/src/autofit/afcjk.c4
-rw-r--r--freetype/src/autofit/afglobal.c11
-rw-r--r--freetype/src/autofit/afhints.c131
-rw-r--r--freetype/src/autofit/afhints.h5
-rw-r--r--freetype/src/autofit/aflatin.c6
-rw-r--r--freetype/src/autofit/aflatin2.c9
-rw-r--r--freetype/src/autofit/afpic.c18
7 files changed, 33 insertions, 151 deletions
diff --git a/freetype/src/autofit/afcjk.c b/freetype/src/autofit/afcjk.c
index bab0c42ba..f3b1067ed 100644
--- a/freetype/src/autofit/afcjk.c
+++ b/freetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK script (body). */
/* */
-/* Copyright 2006, 2007, 2008, 2009 by */
+/* Copyright 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1371,7 +1371,7 @@
FT_UNUSED( metrics );
- error = af_glyph_hints_reload( hints, outline, 0 );
+ error = af_glyph_hints_reload( hints, outline );
if ( error )
goto Exit;
diff --git a/freetype/src/autofit/afglobal.c b/freetype/src/autofit/afglobal.c
index ac293619d..178c884cd 100644
--- a/freetype/src/autofit/afglobal.c
+++ b/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter routines to compute global hinting values (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -167,8 +167,11 @@
for ( nn = 0; nn < globals->glyph_count; nn++ )
{
- if ( gscripts[nn] == AF_SCRIPT_LIST_NONE )
- gscripts[nn] = AF_SCRIPT_LIST_DEFAULT;
+ if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE )
+ {
+ gscripts[nn] &= ~AF_SCRIPT_LIST_NONE;
+ gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT;
+ }
}
}
@@ -183,7 +186,7 @@
{
FT_Error error;
FT_Memory memory;
- AF_FaceGlobals globals;
+ AF_FaceGlobals globals = NULL;
memory = face->memory;
diff --git a/freetype/src/autofit/afhints.c b/freetype/src/autofit/afhints.c
index 3ec4730b9..f899af0f4 100644
--- a/freetype/src/autofit/afhints.c
+++ b/freetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -377,120 +377,6 @@
}
- /* compute all inflex points in a given glyph */
-
- static void
- af_glyph_hints_compute_inflections( AF_GlyphHints hints )
- {
- AF_Point* contour = hints->contours;
- AF_Point* contour_limit = contour + hints->num_contours;
-
-
- /* do each contour separately */
- for ( ; contour < contour_limit; contour++ )
- {
- AF_Point point = contour[0];
- AF_Point first = point;
- AF_Point start = point;
- AF_Point end = point;
- AF_Point before;
- AF_Point after;
- FT_Pos in_x, in_y, out_x, out_y;
- AF_Angle orient_prev, orient_cur;
- FT_Int finished = 0;
-
-
- /* compute first segment in contour */
- first = point;
-
- start = end = first;
- do
- {
- end = end->next;
- if ( end == first )
- goto Skip;
-
- in_x = end->fx - start->fx;
- in_y = end->fy - start->fy;
-
- } while ( in_x == 0 && in_y == 0 );
-
- /* extend the segment start whenever possible */
- before = start;
- do
- {
- do
- {
- start = before;
- before = before->prev;
- if ( before == first )
- goto Skip;
-
- out_x = start->fx - before->fx;
- out_y = start->fy - before->fy;
-
- } while ( out_x == 0 && out_y == 0 );
-
- orient_prev = ft_corner_orientation( in_x, in_y, out_x, out_y );
-
- } while ( orient_prev == 0 );
-
- first = start;
-
- in_x = out_x;
- in_y = out_y;
-
- /* now process all segments in the contour */
- do
- {
- /* first, extend current segment's end whenever possible */
- after = end;
- do
- {
- do
- {
- end = after;
- after = after->next;
- if ( after == first )
- finished = 1;
-
- out_x = after->fx - end->fx;
- out_y = after->fy - end->fy;
-
- } while ( out_x == 0 && out_y == 0 );
-
- orient_cur = ft_corner_orientation( in_x, in_y, out_x, out_y );
-
- } while ( orient_cur == 0 );
-
- if ( ( orient_prev + orient_cur ) == 0 )
- {
- /* we have an inflection point here */
- do
- {
- start->flags |= AF_FLAG_INFLECTION;
- start = start->next;
-
- } while ( start != end );
-
- start->flags |= AF_FLAG_INFLECTION;
- }
-
- start = end;
- end = after;
-
- orient_prev = orient_cur;
- in_x = out_x;
- in_y = out_y;
-
- } while ( !finished );
-
- Skip:
- ;
- }
- }
-
-
FT_LOCAL_DEF( void )
af_glyph_hints_init( AF_GlyphHints hints,
FT_Memory memory )
@@ -551,8 +437,7 @@
FT_LOCAL_DEF( FT_Error )
af_glyph_hints_reload( AF_GlyphHints hints,
- FT_Outline* outline,
- FT_Bool get_inflections )
+ FT_Outline* outline )
{
FT_Error error = AF_Err_Ok;
AF_Point points;
@@ -639,13 +524,11 @@
{
FT_Vector* vec = outline->points;
char* tag = outline->tags;
- AF_Point first = points;
AF_Point end = points + outline->contours[0];
AF_Point prev = end;
FT_Int contour_index = 0;
- FT_UNUSED( first );
for ( point = points; point < point_limit; point++, vec++, tag++ )
{
point->fx = (FT_Short)vec->x;
@@ -673,9 +556,8 @@
{
if ( ++contour_index < outline->n_contours )
{
- first = point + 1;
- end = points + outline->contours[contour_index];
- prev = end;
+ end = points + outline->contours[contour_index];
+ prev = end;
}
}
}
@@ -752,11 +634,6 @@
}
}
- /* compute inflection points -- */
- /* disabled due to no longer perceived benefits */
- if ( 0 && get_inflections )
- af_glyph_hints_compute_inflections( hints );
-
Exit:
return error;
}
diff --git a/freetype/src/autofit/afhints.h b/freetype/src/autofit/afhints.h
index 675826835..10e673b3f 100644
--- a/freetype/src/autofit/afhints.h
+++ b/freetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (specification). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -286,8 +286,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
af_glyph_hints_reload( AF_GlyphHints hints,
- FT_Outline* outline,
- FT_Bool get_inflections );
+ FT_Outline* outline );
FT_LOCAL( void )
af_glyph_hints_save( AF_GlyphHints hints,
diff --git a/freetype/src/autofit/aflatin.c b/freetype/src/autofit/aflatin.c
index e6882d5e7..8c6c430b9 100644
--- a/freetype/src/autofit/aflatin.c
+++ b/freetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -77,7 +77,7 @@
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
- error = af_glyph_hints_reload( hints, &face->glyph->outline, 0 );
+ error = af_glyph_hints_reload( hints, &face->glyph->outline );
if ( error )
goto Exit;
@@ -2105,7 +2105,7 @@
int dim;
- error = af_glyph_hints_reload( hints, outline, 1 );
+ error = af_glyph_hints_reload( hints, outline );
if ( error )
goto Exit;
diff --git a/freetype/src/autofit/aflatin2.c b/freetype/src/autofit/aflatin2.c
index 5cbeb296b..6546475a1 100644
--- a/freetype/src/autofit/aflatin2.c
+++ b/freetype/src/autofit/aflatin2.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -84,7 +84,7 @@
af_glyph_hints_rescale( hints, (AF_ScriptMetrics)dummy );
- error = af_glyph_hints_reload( hints, &face->glyph->outline, 0 );
+ error = af_glyph_hints_reload( hints, &face->glyph->outline );
if ( error )
goto Exit;
@@ -545,7 +545,8 @@
FT_Pos fitted = ( scaled + 40 ) & ~63;
#if 1
- if ( scaled != fitted ) {
+ if ( scaled != fitted )
+ {
scale = FT_MulDiv( scale, fitted, scaled );
AF_LOG(( "== scaled x-top = %.2g fitted = %.2g, scaling = %.4g\n", scaled/64.0, fitted/64.0, (fitted*1.0)/scaled ));
}
@@ -2249,7 +2250,7 @@
int dim;
- error = af_glyph_hints_reload( hints, outline, 1 );
+ error = af_glyph_hints_reload( hints, outline );
if ( error )
goto Exit;
diff --git a/freetype/src/autofit/afpic.c b/freetype/src/autofit/afpic.c
index 6daa109e7..897dbe35d 100644
--- a/freetype/src/autofit/afpic.c
+++ b/freetype/src/autofit/afpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009, 2010 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -45,19 +45,21 @@
}
}
+
FT_Error
- autofit_module_class_pic_init( FT_Library library )
+ autofit_module_class_pic_init( FT_Library library )
{
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_UInt ss;
- FT_Error error = FT_Err_Ok;
- AFModulePIC* container;
- FT_Memory memory = library->memory;
+ FT_PIC_Container* pic_container = &library->pic_container;
+ FT_UInt ss;
+ FT_Error error = AF_Err_Ok;
+ AFModulePIC* container;
+ FT_Memory memory = library->memory;
+
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
- FT_MEM_SET( container, 0, sizeof(*container) );
+ FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->autofit = container;
/* initialize pointer table - this is how the module usually expects this data */