forked from minhngoc25a/freetype2
Whitespace.
This commit is contained in:
parent
fbb0773cb1
commit
eed830614f
|
@ -481,7 +481,8 @@
|
|||
FT_Bool under_ref = FT_BOOL( shoot < ref );
|
||||
|
||||
|
||||
if ( (AF_CJK_BLUE_TOP == bb || AF_CJK_BLUE_RIGHT == bb) ^ under_ref )
|
||||
if ( ( AF_CJK_BLUE_TOP == bb ||
|
||||
AF_CJK_BLUE_RIGHT == bb ) ^ under_ref )
|
||||
*blue_shoot = *blue_ref = ( shoot + ref ) / 2;
|
||||
}
|
||||
|
||||
|
@ -702,7 +703,7 @@
|
|||
{
|
||||
AF_Point pt = seg->first;
|
||||
AF_Point last = seg->last;
|
||||
AF_Flags f0 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||
AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
|
||||
AF_Flags f1;
|
||||
|
||||
|
||||
|
@ -711,7 +712,7 @@
|
|||
for ( ; pt != last; f0 = f1 )
|
||||
{
|
||||
pt = pt->next;
|
||||
f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||
f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
|
||||
|
||||
if ( !f0 && !f1 )
|
||||
break;
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
FT_TRACE7(( "Table of %s segments:\n",
|
||||
dimension == AF_DIMENSION_HORZ ? "vertical"
|
||||
: "horizontal" ));
|
||||
if (axis->num_segments)
|
||||
if ( axis->num_segments )
|
||||
FT_TRACE7(( " [ index | pos | dir | from"
|
||||
" | to | link | serif | edge"
|
||||
" | height | extra | flags ]\n" ));
|
||||
|
@ -350,8 +350,8 @@
|
|||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
seg = &axis->segments[idx];
|
||||
*offset = (dim == AF_DIMENSION_HORZ) ? seg->first->ox
|
||||
: seg->first->oy;
|
||||
*offset = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox
|
||||
: seg->first->oy;
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
|
|
@ -1787,7 +1787,7 @@
|
|||
if ( delta < 0 )
|
||||
delta = -delta;
|
||||
|
||||
if (delta >= 16)
|
||||
if ( delta >= 16 )
|
||||
{
|
||||
dist = org_dist;
|
||||
if ( dist < 48 )
|
||||
|
@ -1914,7 +1914,7 @@
|
|||
continue;
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
if (!anchor)
|
||||
if ( !anchor )
|
||||
FT_TRACE5(( " BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,"
|
||||
" was %.2f (anchor=edge %d)\n",
|
||||
edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,
|
||||
|
@ -2080,7 +2080,7 @@
|
|||
|
||||
cur_pos1 = FT_PIX_ROUND( org_center );
|
||||
|
||||
if (cur_len <= 64 )
|
||||
if ( cur_len <= 64 )
|
||||
{
|
||||
u_off = 32;
|
||||
d_off = 32;
|
||||
|
|
|
@ -824,17 +824,17 @@
|
|||
segment->dir = first->out_dir;
|
||||
segment->first = first;
|
||||
segment->last = point;
|
||||
segment->pos = (FT_Short)(( min_u + max_u ) >> 1);
|
||||
segment->pos = (FT_Short)( ( min_u + max_u ) >> 1 );
|
||||
segment->min_coord = (FT_Short) min_v;
|
||||
segment->max_coord = (FT_Short) max_v;
|
||||
segment->height = (FT_Short)(max_v - min_v);
|
||||
segment->height = (FT_Short)( max_v - min_v );
|
||||
|
||||
/* a segment is round if it doesn't have successive */
|
||||
/* on-curve points. */
|
||||
{
|
||||
AF_Point pt = first;
|
||||
AF_Point last = point;
|
||||
AF_Flags f0 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||
AF_Flags f0 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
|
||||
AF_Flags f1;
|
||||
|
||||
|
||||
|
@ -843,7 +843,7 @@
|
|||
for ( ; pt != last; f0 = f1 )
|
||||
{
|
||||
pt = pt->next;
|
||||
f1 = (AF_Flags)(pt->flags & AF_FLAG_CONTROL);
|
||||
f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );
|
||||
|
||||
if ( !f0 && !f1 )
|
||||
break;
|
||||
|
@ -860,7 +860,7 @@
|
|||
break;
|
||||
|
||||
/* jump to the start of the next segment, if any */
|
||||
while ( FT_ABS(point->out_dir) != major_dir )
|
||||
while ( FT_ABS( point->out_dir ) != major_dir )
|
||||
{
|
||||
point = point->next;
|
||||
|
||||
|
@ -928,16 +928,17 @@
|
|||
FT_UInt count = axis->num_segments;
|
||||
FT_UInt ii, jj;
|
||||
|
||||
for (ii = 0; ii < count; ii++)
|
||||
for ( ii = 0; ii < count; ii++ )
|
||||
{
|
||||
if ( segments[ii].dir > 0 )
|
||||
{
|
||||
for (jj = ii+1; jj < count; jj++)
|
||||
for ( jj = ii + 1; jj < count; jj++ )
|
||||
{
|
||||
if ( segments[jj].dir < 0 )
|
||||
{
|
||||
AF_SegmentRec tmp;
|
||||
|
||||
|
||||
tmp = segments[ii];
|
||||
segments[ii] = segments[jj];
|
||||
segments[jj] = tmp;
|
||||
|
@ -1098,7 +1099,7 @@
|
|||
if ( dim == AF_DIMENSION_HORZ )
|
||||
{
|
||||
if ( laxis->width_count > 0 )
|
||||
segment_length_threshold = (laxis->standard_width * 10 ) >> 4;
|
||||
segment_length_threshold = ( laxis->standard_width * 10 ) >> 4;
|
||||
else
|
||||
segment_length_threshold = FT_DivFix( 64, hints->y_scale );
|
||||
}
|
||||
|
@ -1144,10 +1145,11 @@
|
|||
{
|
||||
FT_Pos dist = seg->serif->pos - seg->pos;
|
||||
|
||||
if (dist < 0)
|
||||
|
||||
if ( dist < 0 )
|
||||
dist = -dist;
|
||||
|
||||
if (dist >= laxis->standard_width >> 1)
|
||||
if ( dist >= laxis->standard_width >> 1 )
|
||||
{
|
||||
/* unlink this serif, it is too distant from its reference stem */
|
||||
seg->serif = NULL;
|
||||
|
@ -1445,7 +1447,7 @@
|
|||
compare = &blue->ref;
|
||||
|
||||
dist = edge->fpos - compare->org;
|
||||
if (dist < 0)
|
||||
if ( dist < 0 )
|
||||
dist = -dist;
|
||||
|
||||
dist = FT_MulFix( dist, scale );
|
||||
|
@ -1549,8 +1551,8 @@
|
|||
* In `light' hinting mode we disable horizontal hinting completely.
|
||||
* We also do it if the face is italic.
|
||||
*/
|
||||
if ( mode == FT_RENDER_MODE_LIGHT ||
|
||||
(face->style_flags & FT_STYLE_FLAG_ITALIC) != 0 )
|
||||
if ( mode == FT_RENDER_MODE_LIGHT ||
|
||||
( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
|
||||
scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
|
||||
|
||||
hints->scaler_flags = scaler_flags;
|
||||
|
@ -1631,8 +1633,8 @@
|
|||
FT_Int sign = 0;
|
||||
FT_Int vertical = ( dim == AF_DIMENSION_VERT );
|
||||
|
||||
FT_UNUSED( base_flags );
|
||||
|
||||
FT_UNUSED(base_flags);
|
||||
|
||||
if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
|
||||
axis->extra_light )
|
||||
|
@ -1762,7 +1764,7 @@
|
|||
if ( delta < 0 )
|
||||
delta = -delta;
|
||||
|
||||
if (delta >= 16)
|
||||
if ( delta >= 16 )
|
||||
{
|
||||
dist = org_dist;
|
||||
if ( dist < 48 )
|
||||
|
@ -1816,7 +1818,7 @@
|
|||
{
|
||||
FT_UNUSED( hints );
|
||||
|
||||
serif->pos = base->pos + (serif->opos - base->opos);
|
||||
serif->pos = base->pos + ( serif->opos - base->opos );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1898,9 +1900,10 @@
|
|||
{
|
||||
anchor = edge;
|
||||
|
||||
anchor_drift = (anchor->pos - anchor->opos);
|
||||
if (edge2)
|
||||
anchor_drift = (anchor_drift + (edge2->pos - edge2->opos)) >> 1;
|
||||
anchor_drift = ( anchor->pos - anchor->opos );
|
||||
if ( edge2 )
|
||||
anchor_drift = ( anchor_drift +
|
||||
( edge2->pos - edge2->opos ) ) >> 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1992,8 +1995,8 @@
|
|||
|
||||
edge2->flags |= AF_EDGE_DONE;
|
||||
|
||||
anchor_drift = ( (anchor->pos - anchor->opos) +
|
||||
(edge2->pos - edge2->opos)) >> 1;
|
||||
anchor_drift = ( ( anchor->pos - anchor->opos ) +
|
||||
( edge2->pos - edge2->opos ) ) >> 1;
|
||||
|
||||
FT_TRACE5(( "DRIFT: %.2f\n", anchor_drift/64.0 ));
|
||||
}
|
||||
|
@ -2012,8 +2015,8 @@
|
|||
(AF_Edge_Flags)edge->flags,
|
||||
(AF_Edge_Flags)edge2->flags );
|
||||
|
||||
org_left = org_pos + ((org_len - cur_len) >> 1);
|
||||
org_right = org_pos + ((org_len + cur_len) >> 1);
|
||||
org_left = org_pos + ( ( org_len - cur_len ) >> 1 );
|
||||
org_right = org_pos + ( ( org_len + cur_len ) >> 1 );
|
||||
|
||||
FT_TRACE5(( "ALIGN: left=%.2f right=%.2f ",
|
||||
org_left / 64.0, org_right / 64.0 ));
|
||||
|
@ -2041,13 +2044,13 @@
|
|||
}
|
||||
|
||||
/* if the span is within a single pixel, don't touch it */
|
||||
if ( FT_PIX_FLOOR(org_left) == FT_PIX_CEIL(org_right) )
|
||||
if ( FT_PIX_FLOOR( org_left ) == FT_PIX_CEIL( org_right ) )
|
||||
{
|
||||
FT_TRACE5(( "single pixel stem\n" ));
|
||||
goto AlignStem;
|
||||
}
|
||||
|
||||
if (cur_len <= 96)
|
||||
if ( cur_len <= 96 )
|
||||
{
|
||||
/* we want to avoid the absolute worst case which is
|
||||
* when the left and right edges of the span each represent
|
||||
|
@ -2055,43 +2058,43 @@
|
|||
* to 25/75%, since this is much more pleasant to the eye with
|
||||
* very acceptable distortion
|
||||
*/
|
||||
FT_Pos frac_left = (org_left) & 63;
|
||||
FT_Pos frac_right = (org_right) & 63;
|
||||
FT_Pos frac_left = org_left & 63;
|
||||
FT_Pos frac_right = org_right & 63;
|
||||
|
||||
if ( frac_left >= 22 && frac_left <= 42 &&
|
||||
frac_right >= 22 && frac_right <= 42 )
|
||||
{
|
||||
org = frac_left;
|
||||
fit = (org <= 32) ? 16 : 48;
|
||||
delta = FT_ABS(fit - org);
|
||||
fit = ( org <= 32 ) ? 16 : 48;
|
||||
delta = FT_ABS( fit - org );
|
||||
displacements[count] = fit - org;
|
||||
scores[count++] = delta;
|
||||
FT_TRACE5(( "dispA=%.2f (%d) ", (fit - org) / 64.0, delta ));
|
||||
FT_TRACE5(( "dispA=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
|
||||
|
||||
org = frac_right;
|
||||
fit = (org <= 32) ? 16 : 48;
|
||||
delta = FT_ABS(fit - org);
|
||||
fit = ( org <= 32 ) ? 16 : 48;
|
||||
delta = FT_ABS( fit - org );
|
||||
displacements[count] = fit - org;
|
||||
scores[count++] = delta;
|
||||
FT_TRACE5(( "dispB=%.2f (%d) ", (fit - org) / 64.0, delta ));
|
||||
FT_TRACE5(( "dispB=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
|
||||
}
|
||||
}
|
||||
|
||||
/* snapping the left edge to the grid */
|
||||
org = org_left;
|
||||
fit = FT_PIX_ROUND(org);
|
||||
delta = FT_ABS(fit - org);
|
||||
fit = FT_PIX_ROUND( org );
|
||||
delta = FT_ABS( fit - org );
|
||||
displacements[count] = fit - org;
|
||||
scores[count++] = delta;
|
||||
FT_TRACE5(( "dispC=%.2f (%d) ", (fit - org) / 64.0, delta ));
|
||||
FT_TRACE5(( "dispC=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
|
||||
|
||||
/* snapping the right edge to the grid */
|
||||
org = org_right;
|
||||
fit = FT_PIX_ROUND(org);
|
||||
delta = FT_ABS(fit - org);
|
||||
fit = FT_PIX_ROUND( org );
|
||||
delta = FT_ABS( fit - org );
|
||||
displacements[count] = fit - org;
|
||||
scores[count++] = delta;
|
||||
FT_TRACE5(( "dispD=%.2f (%d) ", (fit - org) / 64.0, delta ));
|
||||
FT_TRACE5(( "dispD=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
|
||||
|
||||
/* now find the best displacement */
|
||||
{
|
||||
|
@ -2099,9 +2102,9 @@
|
|||
FT_Pos best_disp = displacements[0];
|
||||
FT_UInt nn;
|
||||
|
||||
for (nn = 1; nn < count; nn++)
|
||||
for ( nn = 1; nn < count; nn++ )
|
||||
{
|
||||
if (scores[nn] < best_score)
|
||||
if ( scores[nn] < best_score )
|
||||
{
|
||||
best_score = scores[nn];
|
||||
best_disp = displacements[nn];
|
||||
|
@ -2114,7 +2117,7 @@
|
|||
}
|
||||
|
||||
AlignStem:
|
||||
edge->pos = cur_center - (cur_len >> 1);
|
||||
edge->pos = cur_center - ( cur_len >> 1 );
|
||||
edge2->pos = edge->pos + cur_len;
|
||||
|
||||
FT_TRACE5(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)"
|
||||
|
|
|
@ -69,7 +69,7 @@ FT_BEGIN_HEADER
|
|||
#define AF_SERVICES_GET \
|
||||
( GET_PIC( library )->af_services )
|
||||
#define AF_SERVICE_PROPERTIES_GET \
|
||||
( GET_PIC( library)->af_service_properties )
|
||||
( GET_PIC( library )->af_service_properties )
|
||||
|
||||
#define AF_SCRIPT_CLASSES_GET \
|
||||
( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )
|
||||
|
|
Loading…
Reference in New Issue