summaryrefslogtreecommitdiff
path: root/src/truetype/ttgxvar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/truetype/ttgxvar.c')
-rw-r--r--src/truetype/ttgxvar.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 0cedb6bdf..16a2e56ba 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -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 )
{