[truetype] Fix handling of design coordinates (#51127).

* src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design
coordinates if we have to create the `blends->coord' array.
(TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance
coordinates if no instance is selected yet.
This commit is contained in:
Werner Lemberg 2017-05-27 15:50:25 +02:00
parent 082f2faf50
commit a9331c0f4d
2 changed files with 34 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2017-05-27 Werner Lemberg <wl@gnu.org>
[truetype] Fix handling of design coordinates (#51127).
* src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design
coordinates if we have to create the `blends->coord' array.
(TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance
coordinates if no instance is selected yet.
2017-05-24 Werner Lemberg <wl@gnu.org>
[bdf, pcf] Support ISO646.1991-IRV character encoding (aka ASCII).

View File

@ -2281,7 +2281,10 @@
GX_Blend blend;
FT_MM_Var* mmvar;
FT_UInt i, j;
FT_Bool is_default_instance = 1;
FT_Bool is_default_instance = TRUE;
FT_Bool all_design_coords = FALSE;
FT_Memory memory = face->root.memory;
enum
@ -2327,7 +2330,7 @@
}
if ( coords[i] != 0 )
is_default_instance = 0;
is_default_instance = FALSE;
}
FT_TRACE5(( "\n" ));
@ -2340,6 +2343,9 @@
{
if ( FT_NEW_ARRAY( blend->coords, mmvar->num_axis ) )
goto Exit;
/* the first time we have to compute all design coordinates */
all_design_coords = TRUE;
}
if ( !blend->normalizedcoords )
@ -2388,7 +2394,7 @@
if ( set_design_coords )
ft_var_to_design( face,
num_coords,
all_design_coords ? blend->num_axis : num_coords,
blend->normalizedcoords,
blend->coords );
@ -2529,6 +2535,14 @@
blend = face->blend;
if ( !blend->coords )
{
/* select default instance coordinates */
/* if no instance is selected yet */
if ( FT_SET_ERROR( tt_set_mm_blend( face, 0, NULL, 1 ) ) )
return error;
}
nc = num_coords;
if ( num_coords > blend->num_axis )
{
@ -2686,6 +2700,14 @@
blend = face->blend;
if ( !blend->coords )
{
/* select default instance coordinates */
/* if no instance is selected yet */
if ( FT_SET_ERROR( tt_set_mm_blend( face, 0, NULL, 1 ) ) )
return error;
}
nc = num_coords;
if ( num_coords > blend->num_axis )
{