summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2011-02-26 18:36:21 +0100
committerWerner Lemberg <wl@gnu.org>2011-02-26 18:36:21 +0100
commitb7fc0c74616dc6abe74616dae1b28503c82d00fc (patch)
tree9d5ba4aeb57938e07b27a954884698972d902036 /src
parent6cfbb23ca3665b52357119444a4ba2abd6e489fc (diff)
[autofit] Slight simplifications.
* src/autofit/aflatin.c (af_latin_hints_link_segments): Remove test which always returns false. (af_latin_hints_compute_blue_edges): Remove redundant assignment.
Diffstat (limited to 'src')
-rw-r--r--src/autofit/aflatin.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index c83ea2e5..99e8827b 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -900,47 +900,44 @@
continue;
for ( seg2 = segments; seg2 < segment_limit; seg2++ )
- if ( seg1->dir + seg2->dir == 0 && seg2->pos > seg1->pos )
- {
- FT_Pos pos1 = seg1->pos;
- FT_Pos pos2 = seg2->pos;
- FT_Pos dist = pos2 - pos1;
+ {
+ FT_Pos pos1 = seg1->pos;
+ FT_Pos pos2 = seg2->pos;
- if ( dist < 0 )
- dist = -dist;
+ if ( seg1->dir + seg2->dir == 0 && pos2 > pos1 )
+ {
+ FT_Pos dist = pos2 - pos1;
+ FT_Pos min = seg1->min_coord;
+ FT_Pos max = seg1->max_coord;
+ FT_Pos len, score;
- {
- FT_Pos min = seg1->min_coord;
- FT_Pos max = seg1->max_coord;
- FT_Pos len, score;
+ if ( min < seg2->min_coord )
+ min = seg2->min_coord;
- if ( min < seg2->min_coord )
- min = seg2->min_coord;
+ if ( max > seg2->max_coord )
+ max = seg2->max_coord;
- if ( max > seg2->max_coord )
- max = seg2->max_coord;
+ len = max - min;
+ if ( len >= len_threshold )
+ {
+ score = dist + len_score / len;
- len = max - min;
- if ( len >= len_threshold )
+ if ( score < seg1->score )
{
- score = dist + len_score / len;
-
- if ( score < seg1->score )
- {
- seg1->score = score;
- seg1->link = seg2;
- }
+ seg1->score = score;
+ seg1->link = seg2;
+ }
- if ( score < seg2->score )
- {
- seg2->score = score;
- seg2->link = seg1;
- }
+ if ( score < seg2->score )
+ {
+ seg2->score = score;
+ seg2->link = seg1;
}
}
}
+ }
}
/* now, compute the `serif' segments */
@@ -1339,7 +1336,6 @@
if ( is_top_blue ^ is_under_ref )
{
- blue = latin->blues + bb;
dist = edge->fpos - blue->shoot.org;
if ( dist < 0 )
dist = -dist;