add gvar & HVAR retain-gids test cases

pull/1939/head
Michiharu Ariza 6 years ago
parent 6dd1077b68
commit 0576253a34
  1. BIN
      test/api/fonts/SourceSansVariable-Roman.ac.retaingids.ttf
  2. 22
      test/api/test-subset-gvar.c
  3. 23
      test/api/test-subset-hvar.c

@ -68,6 +68,27 @@ test_subset_gvar (void)
hb_face_destroy (face_ac);
}
static void
test_subset_gvar_retaingids (void)
{
hb_face_t *face_abc = hb_test_open_font_file ("fonts/SourceSansVariable-Roman.abc.ttf");
hb_face_t *face_ac = hb_test_open_font_file ("fonts/SourceSansVariable-Roman.ac.retaingids.ttf");
hb_set_t *codepoints = hb_set_create ();
hb_face_t *face_abc_subset;
hb_set_add (codepoints, 'a');
hb_set_add (codepoints, 'c');
hb_subset_input_t *input = hb_subset_test_create_input (codepoints);
hb_subset_input_set_retain_gids (input, true);
face_abc_subset = hb_subset_test_create_subset (face_abc, input);
hb_set_destroy (codepoints);
hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('g','v','a','r'));
hb_face_destroy (face_abc_subset);
hb_face_destroy (face_abc);
hb_face_destroy (face_ac);
}
int
main (int argc, char **argv)
@ -76,6 +97,7 @@ main (int argc, char **argv)
hb_test_add (test_subset_gvar_noop);
hb_test_add (test_subset_gvar);
hb_test_add (test_subset_gvar_retaingids);
return hb_test_run ();
}

@ -68,6 +68,28 @@ test_subset_HVAR (void)
hb_face_destroy (face_ac);
}
static void
test_subset_HVAR_retaingids (void)
{
hb_face_t *face_abc = hb_test_open_font_file ("fonts/SourceSansVariable-Roman.abc.ttf");
hb_face_t *face_ac = hb_test_open_font_file ("fonts/SourceSansVariable-Roman.ac.retaingids.ttf");
hb_set_t *codepoints = hb_set_create ();
hb_face_t *face_abc_subset;
hb_set_add (codepoints, 'a');
hb_set_add (codepoints, 'c');
hb_subset_input_t *input = hb_subset_test_create_input (codepoints);
hb_subset_input_set_retain_gids (input, true);
face_abc_subset = hb_subset_test_create_subset (face_abc, input);
hb_set_destroy (codepoints);
hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('H','V','A','R'));
hb_face_destroy (face_abc_subset);
hb_face_destroy (face_abc);
hb_face_destroy (face_ac);
}
int
main (int argc, char **argv)
@ -76,6 +98,7 @@ main (int argc, char **argv)
hb_test_add (test_subset_HVAR_noop);
hb_test_add (test_subset_HVAR);
hb_test_add (test_subset_HVAR_retaingids);
return hb_test_run ();
}

Loading…
Cancel
Save