Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
f5f969a8
by Alexei Podtelezhnikov at 2023-02-20T22:29:18-05:00
* src/sdf/ftsdf.c (get_min_distance_cubic): Fix C4701, typos..
-
78464d1b
by Alexei Podtelezhnikov at 2023-02-20T22:31:21-05:00
* src/base/ftoutln.c (FT_Outline_Check): Fix C4701 warning.
-
7f949904
by Alexei Podtelezhnikov at 2023-02-20T23:29:58-05:00
[autofit] Clean up contour indexing.
* src/autofit/aflatin.c (af_latin_metrics_init_blues): Refactor.
* src/autofit/afcjk.c (af_cjk_metrics_init_blues): Ditto.
4 changed files:
Changes:
src/autofit/afcjk.c
... |
... |
@@ -417,16 +417,14 @@ |
417
|
417
|
|
418
|
418
|
{
|
419
|
419
|
FT_Int nn;
|
420
|
|
- FT_Int first = 0;
|
421
|
|
- FT_Int last = -1;
|
|
420
|
+ FT_Int pp, first, last;
|
422
|
421
|
|
423
|
422
|
|
424
|
|
- for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
|
|
423
|
+ last = -1;
|
|
424
|
+ for ( nn = 0; nn < outline.n_contours; nn++ )
|
425
|
425
|
{
|
426
|
|
- FT_Int pp;
|
427
|
|
-
|
428
|
|
-
|
429
|
|
- last = outline.contours[nn];
|
|
426
|
+ first = last + 1;
|
|
427
|
+ last = outline.contours[nn];
|
430
|
428
|
|
431
|
429
|
/* Avoid single-point contours since they are never rasterized. */
|
432
|
430
|
/* In some fonts, they correspond to mark attachment points */
|
src/autofit/aflatin.c
... |
... |
@@ -496,23 +496,20 @@ |
496
|
496
|
/* now compute min or max point indices and coordinates */
|
497
|
497
|
points = outline.points;
|
498
|
498
|
best_point = -1;
|
|
499
|
+ best_contour_first = -1;
|
|
500
|
+ best_contour_last = -1;
|
499
|
501
|
best_y = 0; /* make compiler happy */
|
500
|
|
- best_contour_first = 0; /* ditto */
|
501
|
|
- best_contour_last = 0; /* ditto */
|
502
|
502
|
|
503
|
503
|
{
|
504
|
504
|
FT_Int nn;
|
505
|
|
- FT_Int first = 0;
|
506
|
|
- FT_Int last = -1;
|
|
505
|
+ FT_Int pp, first, last;
|
507
|
506
|
|
508
|
507
|
|
509
|
|
- for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
|
|
508
|
+ last = -1;
|
|
509
|
+ for ( nn = 0; nn < outline.n_contours; nn++ )
|
510
|
510
|
{
|
511
|
|
- FT_Int old_best_point = best_point;
|
512
|
|
- FT_Int pp;
|
513
|
|
-
|
514
|
|
-
|
515
|
|
- last = outline.contours[nn];
|
|
511
|
+ first = last + 1;
|
|
512
|
+ last = outline.contours[nn];
|
516
|
513
|
|
517
|
514
|
/* Avoid single-point contours since they are never */
|
518
|
515
|
/* rasterized. In some fonts, they correspond to mark */
|
... |
... |
@@ -551,7 +548,7 @@ |
551
|
548
|
}
|
552
|
549
|
}
|
553
|
550
|
|
554
|
|
- if ( best_point != old_best_point )
|
|
551
|
+ if ( best_point > best_contour_last )
|
555
|
552
|
{
|
556
|
553
|
best_contour_first = first;
|
557
|
554
|
best_contour_last = last;
|
src/base/ftoutln.c
... |
... |
@@ -379,7 +379,7 @@ |
379
|
379
|
end0 = end;
|
380
|
380
|
}
|
381
|
381
|
|
382
|
|
- if ( end != n_points - 1 )
|
|
382
|
+ if ( end0 != n_points - 1 )
|
383
|
383
|
goto Bad;
|
384
|
384
|
|
385
|
385
|
/* XXX: check the tags array */
|
src/sdf/ftsdf.c
... |
... |
@@ -2375,7 +2375,7 @@ |
2375
|
2375
|
* 90~degrees with the curve. We solve this with the Newton-Raphson
|
2376
|
2376
|
* method.
|
2377
|
2377
|
*
|
2378
|
|
- * (7) We first assume an arbitary value of factor `t`, which we then
|
|
2378
|
+ * (7) We first assume an arbitrary value of factor `t`, which we then
|
2379
|
2379
|
* improve.
|
2380
|
2380
|
*
|
2381
|
2381
|
* ```
|
... |
... |
@@ -2688,7 +2688,7 @@ |
2688
|
2688
|
* 90~degree with curve. We solve this with the Newton-Raphson
|
2689
|
2689
|
* method.
|
2690
|
2690
|
*
|
2691
|
|
- * (7) We first assume an arbitary value of factor `t`, which we then
|
|
2691
|
+ * (7) We first assume an arbitrary value of factor `t`, which we then
|
2692
|
2692
|
* improve.
|
2693
|
2693
|
*
|
2694
|
2694
|
* ```
|
... |
... |
@@ -2718,8 +2718,9 @@ |
2718
|
2718
|
|
2719
|
2719
|
FT_Error error = FT_Err_Ok;
|
2720
|
2720
|
|
2721
|
|
- FT_26D6_Vec aA, bB, cC, dD; /* A, B, C in the above comment */
|
2722
|
|
- FT_16D16_Vec nearest_point; /* point on curve nearest to `point` */
|
|
2721
|
+ FT_26D6_Vec aA, bB, cC, dD; /* A, B, C, D in the above comment */
|
|
2722
|
+ FT_16D16_Vec nearest_point = { 0, 0 };
|
|
2723
|
+ /* point on curve nearest to `point` */
|
2723
|
2724
|
FT_16D16_Vec direction; /* direction of curve at `nearest_point` */
|
2724
|
2725
|
|
2725
|
2726
|
FT_26D6_Vec p0, p1, p2, p3; /* control points of a cubic curve */
|
|