Werner Lemberg pushed to branch master at FreeType / FreeType
Commits:
-
215ae253
by Dominik Röttsches at 2021-02-16T13:15:41+01:00
3 changed files:
Changes:
1 |
+2021-02-16 Dominik Röttsches <drott@chromium.org>
|
|
2 |
+ |
|
3 |
+ [sfnt] Update paint format values to support non-variable paints.
|
|
4 |
+ |
|
5 |
+ * freetype.h (FT_PaintFormat): Update paint format identifiers after
|
|
6 |
+ a specification change. The specification was updated to have
|
|
7 |
+ sibling formats, variable and non-variable variants for each.
|
|
8 |
+ Reflect that here.
|
|
9 |
+ |
|
10 |
+ * sfnt/ttcolr.c (read_paint): Remove parsing of variable indices as
|
|
11 |
+ the non-variable formats no longer have them.
|
|
12 |
+ |
|
1 | 13 |
2021-02-15 Daniel E <daniel.engberg.lists@pyret.net>
|
2 | 14 |
|
3 | 15 |
* CMakeLists.txt: Improve 'bz2' support.
|
... | ... | @@ -4256,25 +4256,32 @@ FT_BEGIN_HEADER |
4256 | 4256 |
* FT_PaintFormat
|
4257 | 4257 |
*
|
4258 | 4258 |
* @description:
|
4259 |
- * Enumeration describing the different gradient types of the v1
|
|
4259 |
+ * Enumeration describing the different paint format types of the v1
|
|
4260 | 4260 |
* extensions to the 'COLR' table, see
|
4261 | 4261 |
* 'https://github.com/googlefonts/colr-gradients-spec'.
|
4262 |
+ *
|
|
4263 |
+ * Only non-variable format identifiers are listed in this enumeration;
|
|
4264 |
+ * as soon as support for variable 'COLR' v1 fonts is implemented,
|
|
4265 |
+ * interpolation is performed dependent on axis coordinates, which are
|
|
4266 |
+ * configured on the @FT_Face through @FT_Set_Var_Design_Coordinates.
|
|
4267 |
+ * This implies that always static (interpolated) values are returned
|
|
4268 |
+ * for both variable and non-variable formats.
|
|
4262 | 4269 |
*/
|
4263 | 4270 |
typedef enum FT_PaintFormat_
|
4264 | 4271 |
{
|
4265 | 4272 |
FT_COLR_PAINTFORMAT_COLR_LAYERS = 1,
|
4266 | 4273 |
FT_COLR_PAINTFORMAT_SOLID = 2,
|
4267 |
- FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 3,
|
|
4268 |
- FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 4,
|
|
4269 |
- FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 5,
|
|
4270 |
- FT_COLR_PAINTFORMAT_GLYPH = 6,
|
|
4271 |
- FT_COLR_PAINTFORMAT_COLR_GLYPH = 7,
|
|
4272 |
- FT_COLR_PAINTFORMAT_TRANSFORMED = 8,
|
|
4273 |
- FT_COLR_PAINTFORMAT_TRANSLATE = 9,
|
|
4274 |
- FT_COLR_PAINTFORMAT_ROTATE = 10,
|
|
4275 |
- FT_COLR_PAINTFORMAT_SKEW = 11,
|
|
4276 |
- FT_COLR_PAINTFORMAT_COMPOSITE = 12,
|
|
4277 |
- FT_COLR_PAINT_FORMAT_MAX = 13,
|
|
4274 |
+ FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4,
|
|
4275 |
+ FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6,
|
|
4276 |
+ FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8,
|
|
4277 |
+ FT_COLR_PAINTFORMAT_GLYPH = 10,
|
|
4278 |
+ FT_COLR_PAINTFORMAT_COLR_GLYPH = 11,
|
|
4279 |
+ FT_COLR_PAINTFORMAT_TRANSFORMED = 12,
|
|
4280 |
+ FT_COLR_PAINTFORMAT_TRANSLATE = 14,
|
|
4281 |
+ FT_COLR_PAINTFORMAT_ROTATE = 16,
|
|
4282 |
+ FT_COLR_PAINTFORMAT_SKEW = 18,
|
|
4283 |
+ FT_COLR_PAINTFORMAT_COMPOSITE = 20,
|
|
4284 |
+ FT_COLR_PAINT_FORMAT_MAX = 21,
|
|
4278 | 4285 |
FT_COLR_PAINTFORMAT_UNSUPPORTED = 255
|
4279 | 4286 |
|
4280 | 4287 |
} FT_PaintFormat;
|
... | ... | @@ -405,8 +405,6 @@ |
405 | 405 |
{
|
406 | 406 |
apaint->u.solid.color.palette_index = FT_NEXT_USHORT ( p );
|
407 | 407 |
apaint->u.solid.color.alpha = FT_NEXT_USHORT ( p );
|
408 |
- /* skip VarIdx */
|
|
409 |
- FT_NEXT_ULONG ( p );
|
|
410 | 408 |
}
|
411 | 409 |
|
412 | 410 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_LINEAR_GRADIENT )
|
... | ... | @@ -419,19 +417,12 @@ |
419 | 417 |
&apaint->u.linear_gradient.colorline ) )
|
420 | 418 |
return 0;
|
421 | 419 |
|
422 |
- /* skip VarIdx entries */
|
|
423 | 420 |
apaint->u.linear_gradient.p0.x = FT_NEXT_SHORT ( p );
|
424 |
- FT_NEXT_ULONG ( p );
|
|
425 | 421 |
apaint->u.linear_gradient.p0.y = FT_NEXT_SHORT ( p );
|
426 |
- FT_NEXT_ULONG ( p );
|
|
427 | 422 |
apaint->u.linear_gradient.p1.x = FT_NEXT_SHORT ( p );
|
428 |
- FT_NEXT_ULONG ( p );
|
|
429 | 423 |
apaint->u.linear_gradient.p1.y = FT_NEXT_SHORT ( p );
|
430 |
- FT_NEXT_ULONG ( p );
|
|
431 | 424 |
apaint->u.linear_gradient.p2.x = FT_NEXT_SHORT ( p );
|
432 |
- FT_NEXT_ULONG ( p );
|
|
433 | 425 |
apaint->u.linear_gradient.p2.y = FT_NEXT_SHORT ( p );
|
434 |
- FT_NEXT_ULONG ( p );
|
|
435 | 426 |
}
|
436 | 427 |
|
437 | 428 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_RADIAL_GRADIENT )
|
... | ... | @@ -444,22 +435,15 @@ |
444 | 435 |
&apaint->u.radial_gradient.colorline ) )
|
445 | 436 |
return 0;
|
446 | 437 |
|
447 |
- /* skip VarIdx entries */
|
|
448 | 438 |
apaint->u.radial_gradient.c0.x = FT_NEXT_SHORT ( p );
|
449 |
- FT_NEXT_ULONG ( p );
|
|
450 | 439 |
apaint->u.radial_gradient.c0.y = FT_NEXT_SHORT ( p );
|
451 |
- FT_NEXT_ULONG ( p );
|
|
452 | 440 |
|
453 | 441 |
apaint->u.radial_gradient.r0 = FT_NEXT_USHORT ( p );
|
454 |
- FT_NEXT_ULONG ( p );
|
|
455 | 442 |
|
456 | 443 |
apaint->u.radial_gradient.c1.x = FT_NEXT_SHORT ( p );
|
457 |
- FT_NEXT_ULONG ( p );
|
|
458 | 444 |
apaint->u.radial_gradient.c1.y = FT_NEXT_SHORT ( p );
|
459 |
- FT_NEXT_ULONG ( p );
|
|
460 | 445 |
|
461 | 446 |
apaint->u.radial_gradient.r1 = FT_NEXT_USHORT ( p );
|
462 |
- FT_NEXT_ULONG ( p );
|
|
463 | 447 |
}
|
464 | 448 |
|
465 | 449 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_SWEEP_GRADIENT )
|
... | ... | @@ -472,16 +456,11 @@ |
472 | 456 |
&apaint->u.sweep_gradient.colorline ) )
|
473 | 457 |
return 0;
|
474 | 458 |
|
475 |
- /* skip VarIdx entries */
|
|
476 | 459 |
apaint->u.sweep_gradient.center.x = FT_NEXT_SHORT ( p );
|
477 |
- FT_NEXT_ULONG ( p );
|
|
478 | 460 |
apaint->u.sweep_gradient.center.y = FT_NEXT_SHORT ( p );
|
479 |
- FT_NEXT_ULONG ( p );
|
|
480 | 461 |
|
481 | 462 |
apaint->u.sweep_gradient.start_angle = FT_NEXT_LONG( p );
|
482 |
- FT_NEXT_ULONG ( p );
|
|
483 | 463 |
apaint->u.sweep_gradient.end_angle = FT_NEXT_LONG( p );
|
484 |
- FT_NEXT_ULONG ( p );
|
|
485 | 464 |
}
|
486 | 465 |
|
487 | 466 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSFORMED )
|
... | ... | @@ -501,19 +480,12 @@ |
501 | 480 |
apaint->u.transformed.paint.p = paint_p;
|
502 | 481 |
apaint->u.transformed.paint.insert_root_transform = 0;
|
503 | 482 |
|
504 |
- /* skip VarIdx entries */
|
|
505 | 483 |
apaint->u.transformed.affine.xx = FT_NEXT_LONG( p );
|
506 |
- FT_NEXT_ULONG( p );
|
|
507 | 484 |
apaint->u.transformed.affine.yx = FT_NEXT_LONG( p );
|
508 |
- FT_NEXT_ULONG( p );
|
|
509 | 485 |
apaint->u.transformed.affine.xy = FT_NEXT_LONG( p );
|
510 |
- FT_NEXT_ULONG( p );
|
|
511 | 486 |
apaint->u.transformed.affine.yy = FT_NEXT_LONG( p );
|
512 |
- FT_NEXT_ULONG( p );
|
|
513 | 487 |
apaint->u.transformed.affine.dx = FT_NEXT_LONG( p );
|
514 |
- FT_NEXT_ULONG( p );
|
|
515 | 488 |
apaint->u.transformed.affine.dy = FT_NEXT_LONG( p );
|
516 |
- FT_NEXT_ULONG( p );
|
|
517 | 489 |
}
|
518 | 490 |
|
519 | 491 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSLATE )
|
... | ... | @@ -533,11 +505,8 @@ |
533 | 505 |
apaint->u.translate.paint.p = paint_p;
|
534 | 506 |
apaint->u.translate.paint.insert_root_transform = 0;
|
535 | 507 |
|
536 |
- /* skip VarIdx entries */
|
|
537 | 508 |
apaint->u.translate.dx = FT_NEXT_LONG( p );
|
538 |
- FT_NEXT_ULONG( p );
|
|
539 | 509 |
apaint->u.translate.dy = FT_NEXT_LONG( p );
|
540 |
- FT_NEXT_ULONG( p );
|
|
541 | 510 |
}
|
542 | 511 |
|
543 | 512 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_ROTATE )
|
... | ... | @@ -557,14 +526,10 @@ |
557 | 526 |
apaint->u.rotate.paint.p = paint_p;
|
558 | 527 |
apaint->u.rotate.paint.insert_root_transform = 0;
|
559 | 528 |
|
560 |
- /* skip VarIdx entries */
|
|
561 | 529 |
apaint->u.rotate.angle = FT_NEXT_LONG( p );
|
562 |
- FT_NEXT_ULONG( p );
|
|
563 | 530 |
|
564 | 531 |
apaint->u.rotate.center_x = FT_NEXT_LONG( p );
|
565 |
- FT_NEXT_ULONG( p );
|
|
566 | 532 |
apaint->u.rotate.center_y = FT_NEXT_LONG( p );
|
567 |
- FT_NEXT_ULONG( p );
|
|
568 | 533 |
}
|
569 | 534 |
|
570 | 535 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_SKEW )
|
... | ... | @@ -584,16 +549,11 @@ |
584 | 549 |
apaint->u.skew.paint.p = paint_p;
|
585 | 550 |
apaint->u.skew.paint.insert_root_transform = 0;
|
586 | 551 |
|
587 |
- /* skip VarIdx entries */
|
|
588 | 552 |
apaint->u.skew.x_skew_angle = FT_NEXT_LONG( p );
|
589 |
- FT_NEXT_ULONG( p );
|
|
590 | 553 |
apaint->u.skew.y_skew_angle = FT_NEXT_LONG( p );
|
591 |
- FT_NEXT_ULONG( p );
|
|
592 | 554 |
|
593 | 555 |
apaint->u.skew.center_x = FT_NEXT_LONG( p );
|
594 |
- FT_NEXT_ULONG( p );
|
|
595 | 556 |
apaint->u.skew.center_y = FT_NEXT_LONG( p );
|
596 |
- FT_NEXT_ULONG( p );
|
|
597 | 557 |
}
|
598 | 558 |
|
599 | 559 |
else if ( apaint->format == FT_COLR_PAINTFORMAT_COMPOSITE )
|
... | ... | @@ -814,14 +774,11 @@ |
814 | 774 |
/* Iterator points at first `ColorStop` of `ColorLine`. */
|
815 | 775 |
p = iterator->p;
|
816 | 776 |
|
817 |
- /* skip VarIdx entries */
|
|
818 | 777 |
color_stop->stop_offset = FT_NEXT_USHORT ( p );
|
819 |
- FT_NEXT_ULONG ( p );
|
|
820 | 778 |
|
821 | 779 |
color_stop->color.palette_index = FT_NEXT_USHORT ( p );
|
822 | 780 |
|
823 | 781 |
color_stop->color.alpha = FT_NEXT_USHORT ( p );
|
824 |
- FT_NEXT_ULONG ( p );
|
|
825 | 782 |
|
826 | 783 |
iterator->p = p;
|
827 | 784 |
iterator->current_color_stop++;
|