... |
... |
@@ -1050,7 +1050,7 @@ |
1050
|
1050
|
}
|
1051
|
1051
|
|
1052
|
1052
|
|
1053
|
|
- static int
|
|
1053
|
+ static PSH_Dir
|
1054
|
1054
|
psh_compute_dir( FT_Pos dx,
|
1055
|
1055
|
FT_Pos dy )
|
1056
|
1056
|
{
|
... |
... |
@@ -1234,12 +1234,12 @@ |
1234
|
1234
|
dxi = vec[n].x - vec[n_prev].x;
|
1235
|
1235
|
dyi = vec[n].y - vec[n_prev].y;
|
1236
|
1236
|
|
1237
|
|
- point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi );
|
|
1237
|
+ point->dir_in = psh_compute_dir( dxi, dyi );
|
1238
|
1238
|
|
1239
|
1239
|
dxo = vec[n_next].x - vec[n].x;
|
1240
|
1240
|
dyo = vec[n_next].y - vec[n].y;
|
1241
|
1241
|
|
1242
|
|
- point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo );
|
|
1242
|
+ point->dir_out = psh_compute_dir( dxo, dyo );
|
1243
|
1243
|
|
1244
|
1244
|
/* detect smooth points */
|
1245
|
1245
|
if ( point->flags & PSH_POINT_OFF )
|
... |
... |
@@ -1404,16 +1404,13 @@ |
1404
|
1404
|
}
|
1405
|
1405
|
|
1406
|
1406
|
|
1407
|
|
- /* major_dir is the direction for points on the bottom/left of the stem; */
|
1408
|
|
- /* Points on the top/right of the stem will have a direction of */
|
1409
|
|
- /* -major_dir. */
|
1410
|
|
-
|
|
1407
|
+ /* the min and max are based on contour orientation and fill rule */
|
1411
|
1408
|
static void
|
1412
|
1409
|
psh_hint_table_find_strong_points( PSH_Hint_Table table,
|
1413
|
1410
|
PSH_Point point,
|
1414
|
1411
|
FT_UInt count,
|
1415
|
1412
|
FT_Int threshold,
|
1416
|
|
- FT_Int major_dir )
|
|
1413
|
+ PSH_Dir major_dir )
|
1417
|
1414
|
{
|
1418
|
1415
|
PSH_Hint* sort = table->sort;
|
1419
|
1416
|
FT_UInt num_hints = table->num_hints;
|
... |
... |
@@ -1421,59 +1418,56 @@ |
1421
|
1418
|
|
1422
|
1419
|
for ( ; count > 0; count--, point++ )
|
1423
|
1420
|
{
|
1424
|
|
- FT_Int point_dir = 0;
|
1425
|
|
- FT_Pos org_u = point->org_u;
|
|
1421
|
+ PSH_Dir point_dir = PSH_DIR_NONE;
|
|
1422
|
+ FT_Pos org_u = point->org_u;
|
1426
|
1423
|
|
1427
|
1424
|
|
1428
|
1425
|
if ( psh_point_is_strong( point ) )
|
1429
|
1426
|
continue;
|
1430
|
1427
|
|
1431
|
|
- if ( PSH_DIR_COMPARE( point->dir_in, major_dir ) )
|
|
1428
|
+ if ( point->dir_in & major_dir )
|
1432
|
1429
|
point_dir = point->dir_in;
|
1433
|
1430
|
|
1434
|
|
- else if ( PSH_DIR_COMPARE( point->dir_out, major_dir ) )
|
|
1431
|
+ else if ( point->dir_out & major_dir )
|
1435
|
1432
|
point_dir = point->dir_out;
|
1436
|
1433
|
|
1437
|
|
- if ( point_dir )
|
|
1434
|
+ if ( point_dir & ( PSH_DIR_DOWN | PSH_DIR_RIGHT ) )
|
1438
|
1435
|
{
|
1439
|
|
- if ( point_dir == major_dir )
|
1440
|
|
- {
|
1441
|
|
- FT_UInt nn;
|
|
1436
|
+ FT_UInt nn;
|
1442
|
1437
|
|
1443
|
1438
|
|
1444
|
|
- for ( nn = 0; nn < num_hints; nn++ )
|
1445
|
|
- {
|
1446
|
|
- PSH_Hint hint = sort[nn];
|
1447
|
|
- FT_Pos d = org_u - hint->org_pos;
|
|
1439
|
+ for ( nn = 0; nn < num_hints; nn++ )
|
|
1440
|
+ {
|
|
1441
|
+ PSH_Hint hint = sort[nn];
|
|
1442
|
+ FT_Pos d = org_u - hint->org_pos;
|
1448
|
1443
|
|
1449
|
1444
|
|
1450
|
|
- if ( d < threshold && -d < threshold )
|
1451
|
|
- {
|
1452
|
|
- psh_point_set_strong( point );
|
1453
|
|
- point->flags2 |= PSH_POINT_EDGE_MIN;
|
1454
|
|
- point->hint = hint;
|
1455
|
|
- break;
|
1456
|
|
- }
|
|
1445
|
+ if ( d < threshold && -d < threshold )
|
|
1446
|
+ {
|
|
1447
|
+ psh_point_set_strong( point );
|
|
1448
|
+ point->flags2 |= PSH_POINT_EDGE_MIN;
|
|
1449
|
+ point->hint = hint;
|
|
1450
|
+ break;
|
1457
|
1451
|
}
|
1458
|
1452
|
}
|
1459
|
|
- else if ( point_dir == -major_dir )
|
1460
|
|
- {
|
1461
|
|
- FT_UInt nn;
|
|
1453
|
+ }
|
|
1454
|
+ else if ( point_dir & ( PSH_DIR_UP | PSH_DIR_LEFT ) )
|
|
1455
|
+ {
|
|
1456
|
+ FT_UInt nn;
|
1462
|
1457
|
|
1463
|
1458
|
|
1464
|
|
- for ( nn = 0; nn < num_hints; nn++ )
|
1465
|
|
- {
|
1466
|
|
- PSH_Hint hint = sort[nn];
|
1467
|
|
- FT_Pos d = org_u - hint->org_pos - hint->org_len;
|
|
1459
|
+ for ( nn = 0; nn < num_hints; nn++ )
|
|
1460
|
+ {
|
|
1461
|
+ PSH_Hint hint = sort[nn];
|
|
1462
|
+ FT_Pos d = org_u - hint->org_pos - hint->org_len;
|
1468
|
1463
|
|
1469
|
1464
|
|
1470
|
|
- if ( d < threshold && -d < threshold )
|
1471
|
|
- {
|
1472
|
|
- psh_point_set_strong( point );
|
1473
|
|
- point->flags2 |= PSH_POINT_EDGE_MAX;
|
1474
|
|
- point->hint = hint;
|
1475
|
|
- break;
|
1476
|
|
- }
|
|
1465
|
+ if ( d < threshold && -d < threshold )
|
|
1466
|
+ {
|
|
1467
|
+ psh_point_set_strong( point );
|
|
1468
|
+ point->flags2 |= PSH_POINT_EDGE_MAX;
|
|
1469
|
+ point->hint = hint;
|
|
1470
|
+ break;
|
1477
|
1471
|
}
|
1478
|
1472
|
}
|
1479
|
1473
|
}
|
... |
... |
@@ -1572,7 +1566,7 @@ |
1572
|
1566
|
PS_Mask mask = table->hint_masks->masks;
|
1573
|
1567
|
FT_UInt num_masks = table->hint_masks->num_masks;
|
1574
|
1568
|
FT_UInt first = 0;
|
1575
|
|
- FT_Int major_dir = ( dimension == 0 ) ? PSH_DIR_VERTICAL
|
|
1569
|
+ PSH_Dir major_dir = ( dimension == 0 ) ? PSH_DIR_VERTICAL
|
1576
|
1570
|
: PSH_DIR_HORIZONTAL;
|
1577
|
1571
|
PSH_Dimension dim = &glyph->globals->dimension[dimension];
|
1578
|
1572
|
FT_Fixed scale = dim->scale_mult;
|
... |
... |
@@ -1657,8 +1651,8 @@ |
1657
|
1651
|
|
1658
|
1652
|
|
1659
|
1653
|
/* check tangents */
|
1660
|
|
- if ( !PSH_DIR_COMPARE( point->dir_in, PSH_DIR_HORIZONTAL ) &&
|
1661
|
|
- !PSH_DIR_COMPARE( point->dir_out, PSH_DIR_HORIZONTAL ) )
|
|
1654
|
+ if ( !( point->dir_in & PSH_DIR_HORIZONTAL ) &&
|
|
1655
|
+ !( point->dir_out & PSH_DIR_HORIZONTAL ) )
|
1662
|
1656
|
continue;
|
1663
|
1657
|
|
1664
|
1658
|
/* skip strong points */
|