forked from minhngoc25a/freetype2
[autofit] Variable renamings.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace `glyph' with `outline'. s/best_first/best_contour_first/. s/best_last/best_contour_last/.
This commit is contained in:
parent
5cdeb3cd60
commit
e194d7cd61
|
@ -1,3 +1,12 @@
|
||||||
|
2012-08-05 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[autofit] Variable renamings.
|
||||||
|
|
||||||
|
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace
|
||||||
|
`glyph' with `outline'.
|
||||||
|
s/best_first/best_contour_first/.
|
||||||
|
s/best_last/best_contour_last/.
|
||||||
|
|
||||||
2012-07-31 Werner Lemberg <wl@gnu.org>
|
2012-07-31 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
Fix Savannah bug #37000.
|
Fix Savannah bug #37000.
|
||||||
|
|
|
@ -198,7 +198,7 @@
|
||||||
AF_LatinBlue blue;
|
AF_LatinBlue blue;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT];
|
AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT];
|
||||||
FT_GlyphSlot glyph = face->glyph;
|
FT_Outline outline;
|
||||||
|
|
||||||
|
|
||||||
/* we compute the blues simply by loading each character from the */
|
/* we compute the blues simply by loading each character from the */
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
{
|
{
|
||||||
FT_UInt glyph_index;
|
FT_UInt glyph_index;
|
||||||
FT_Pos best_y; /* same as points.y */
|
FT_Pos best_y; /* same as points.y */
|
||||||
FT_Int best_point, best_first, best_last;
|
FT_Int best_point, best_contour_first, best_contour_last;
|
||||||
FT_Vector* points;
|
FT_Vector* points;
|
||||||
FT_Bool round = 0;
|
FT_Bool round = 0;
|
||||||
|
|
||||||
|
@ -235,16 +235,17 @@
|
||||||
if ( glyph_index == 0 )
|
if ( glyph_index == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
|
||||||
if ( error || glyph->outline.n_points <= 0 )
|
outline = face->glyph->outline;
|
||||||
|
if ( error || outline.n_points <= 0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* now compute min or max point indices and coordinates */
|
/* now compute min or max point indices and coordinates */
|
||||||
points = glyph->outline.points;
|
points = outline.points;
|
||||||
best_point = -1;
|
best_point = -1;
|
||||||
best_y = 0; /* make compiler happy */
|
best_y = 0; /* make compiler happy */
|
||||||
best_first = 0; /* ditto */
|
best_contour_first = 0; /* ditto */
|
||||||
best_last = 0; /* ditto */
|
best_contour_last = 0; /* ditto */
|
||||||
|
|
||||||
{
|
{
|
||||||
FT_Int nn;
|
FT_Int nn;
|
||||||
|
@ -252,15 +253,13 @@
|
||||||
FT_Int last = -1;
|
FT_Int last = -1;
|
||||||
|
|
||||||
|
|
||||||
for ( nn = 0;
|
for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
|
||||||
nn < glyph->outline.n_contours;
|
|
||||||
first = last + 1, nn++ )
|
|
||||||
{
|
{
|
||||||
FT_Int old_best_point = best_point;
|
FT_Int old_best_point = best_point;
|
||||||
FT_Int pp;
|
FT_Int pp;
|
||||||
|
|
||||||
|
|
||||||
last = glyph->outline.contours[nn];
|
last = outline.contours[nn];
|
||||||
|
|
||||||
/* Avoid single-point contours since they are never rasterized. */
|
/* Avoid single-point contours since they are never rasterized. */
|
||||||
/* In some fonts, they correspond to mark attachment points */
|
/* In some fonts, they correspond to mark attachment points */
|
||||||
|
@ -289,8 +288,8 @@
|
||||||
|
|
||||||
if ( best_point != old_best_point )
|
if ( best_point != old_best_point )
|
||||||
{
|
{
|
||||||
best_first = first;
|
best_contour_first = first;
|
||||||
best_last = last;
|
best_contour_last = last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FT_TRACE5(( " %c %ld", *p, best_y ));
|
FT_TRACE5(( " %c %ld", *p, best_y ));
|
||||||
|
@ -313,10 +312,10 @@
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ( prev > best_first )
|
if ( prev > best_contour_first )
|
||||||
prev--;
|
prev--;
|
||||||
else
|
else
|
||||||
prev = best_last;
|
prev = best_contour_last;
|
||||||
|
|
||||||
dist = FT_ABS( points[prev].y - best_y );
|
dist = FT_ABS( points[prev].y - best_y );
|
||||||
/* accept a small distance or a small angle (both values are */
|
/* accept a small distance or a small angle (both values are */
|
||||||
|
@ -329,10 +328,10 @@
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if ( next < best_last )
|
if ( next < best_contour_last )
|
||||||
next++;
|
next++;
|
||||||
else
|
else
|
||||||
next = best_first;
|
next = best_contour_first;
|
||||||
|
|
||||||
dist = FT_ABS( points[next].y - best_y );
|
dist = FT_ABS( points[next].y - best_y );
|
||||||
if ( dist > 5 )
|
if ( dist > 5 )
|
||||||
|
@ -343,8 +342,8 @@
|
||||||
|
|
||||||
/* now set the `round' flag depending on the segment's kind */
|
/* now set the `round' flag depending on the segment's kind */
|
||||||
round = FT_BOOL(
|
round = FT_BOOL(
|
||||||
FT_CURVE_TAG( glyph->outline.tags[prev] ) != FT_CURVE_TAG_ON ||
|
FT_CURVE_TAG( outline.tags[prev] ) != FT_CURVE_TAG_ON ||
|
||||||
FT_CURVE_TAG( glyph->outline.tags[next] ) != FT_CURVE_TAG_ON );
|
FT_CURVE_TAG( outline.tags[next] ) != FT_CURVE_TAG_ON );
|
||||||
|
|
||||||
FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
|
FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue