* src/pshinter/pshalgo3.c (psh3_glyph_compute_extrema): Skip contours with only a single point to avoid segfault. * src/autohint/ahtypes.h (AH_OPTION_NO_STRONG_INTERPOLATION): Removed since unused.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
diff --git a/ChangeLog b/ChangeLog
index 086ade9..4d88cb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-05-28 Werner Lemberg <wl@gnu.org>
+
+ * src/pshinter/pshalgo3.c (psh3_glyph_compute_extrema): Skip
+ contours with only a single point to avoid segfault.
+
+2003-05-24 Werner Lemberg <wl@gnu.org>
+
+ * src/autohint/ahtypes.h (AH_OPTION_NO_STRONG_INTERPOLATION):
+ Removed since unused.
+
2003-05-21 Werner Lemberg <wl@gnu.org>
* include/freetype/config/ftstdlib.h (ft_strcat): New wrapper macro
diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c
index 120c4a2..4183b01 100644
--- a/src/autohint/ahglobal.c
+++ b/src/autohint/ahglobal.c
@@ -27,6 +27,8 @@
#define MAX_TEST_CHARACTERS 12
+ /* cf. AH_BLUE_XXX constants in ahtypes.h */
+
static
const char* blue_chars[AH_BLUE_MAX] =
{
@@ -93,8 +95,8 @@
goto Exit;
/* we compute the blues simply by loading each character from the */
- /* 'blue_chars[blues]' string, then compute its top-most and */
- /* bottom-most points */
+ /* 'blue_chars[blues]' string, then compute its top-most or */
+ /* bottom-most points (depending on `AH_IS_TOP_BLUE') */
AH_LOG(( "blue zones computation\n" ));
AH_LOG(( "------------------------------------------------\n" ));
@@ -103,6 +105,7 @@
{
const char* p = blue_chars[blue];
const char* limit = p + MAX_TEST_CHARACTERS;
+
FT_Pos *blue_ref, *blue_shoot;
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 91f3b72..85c3b38 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -996,8 +996,8 @@
/* we do this by inserting fake segments when needed */
if ( dimension == 0 )
{
- AH_Point point = outline->points;
- AH_Point point_limit = point + outline->num_points;
+ AH_Point point = outline->points;
+ AH_Point point_limit = point + outline->num_points;
FT_Pos min_pos = 32000;
FT_Pos max_pos = -32000;
@@ -1067,6 +1067,7 @@
segments = outline->vert_segments;
major_dir = AH_DIR_UP;
p_num_segments = &outline->num_vsegments;
+
ah_setup_uv( outline, AH_UV_FXY );
}
}
@@ -1485,7 +1486,7 @@
edge->dir = up_dir;
else if ( ups < downs )
- edge->dir = - up_dir;
+ edge->dir = -up_dir;
else if ( ups == downs )
edge->dir = 0; /* both up and down! */
@@ -1579,7 +1580,7 @@
return;
}
- /* compute for each horizontal edge, which blue zone is closer */
+ /* for each horizontal edge search the blue zone which is closest */
for ( ; edge < edge_limit; edge++ )
{
AH_Blue blue;
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index c17baa6..177be47 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -699,6 +699,10 @@
/* glyph is not an m), so the potential for unwanted distortion is */
/* relatively low. */
+ /* We don't handle horizontal edges since we can't easily assure that */
+ /* the third (lowest) stem aligns with the base line; it might end up */
+ /* one pixel higher or lower. */
+
n_edges = edge_limit - edges;
if ( !dimension && ( n_edges == 6 || n_edges == 12 ) )
{
@@ -1580,7 +1584,7 @@
FT_SubGlyph subglyph;
- start_point = gloader->base.outline.n_points;
+ start_point = gloader->base.outline.n_points;
/* first of all, copy the subglyph descriptors in the glyph loader */
error = ah_loader_check_subglyphs( gloader, num_subglyphs );
@@ -1663,8 +1667,8 @@
FT_Vector* p2;
- if ( start_point + k >= num_base_points ||
- l >= (FT_UInt)num_new_points )
+ if ( start_point + k >= num_base_points ||
+ l >= (FT_UInt)num_new_points )
{
error = AH_Err_Invalid_Composite;
goto Exit;
@@ -1822,7 +1826,7 @@
/* adust x_scale
*/
if ( fitted < scaled )
- x_scale -= x_scale/50; /* x_scale*0.98 with integers */
+ x_scale -= x_scale / 50; /* x_scale*0.98 with integers */
}
}
}
diff --git a/src/autohint/ahtypes.h b/src/autohint/ahtypes.h
index 947ee62..c748b66 100644
--- a/src/autohint/ahtypes.h
+++ b/src/autohint/ahtypes.h
@@ -78,16 +78,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
- /* If this option is defined, only weak interpolation will be used to */
- /* place the points between edges. Otherwise, `strong' points are */
- /* detected and later hinted through strong interpolation to correct */
- /* some unpleasant artefacts. */
- /* */
-#undef AH_OPTION_NO_STRONG_INTERPOLATION
-
-
- /*************************************************************************/
- /* */
/* Undefine this macro if you don't want to hint the metrics. There is */
/* no reason to do this (at least for non-CJK scripts), except for */
/* experimentation. */
diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c
index 28ffd1a..6d5aca4 100644
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -1261,6 +1261,9 @@
PSH3_Point point, before, after;
+ if ( glyph->contours[n].count == 0 )
+ continue;
+
point = first;
before = point;
after = point;