[subset] update the test file for composite, fix an offset calculation

This commit is contained in:
Rod Sheeter 2018-02-27 20:17:04 -08:00
parent c8b230e437
commit ffcb5cbf71
3 changed files with 3 additions and 4 deletions

View File

@ -412,7 +412,7 @@ struct glyf
} while (composite_it.move_to_next()); } while (composite_it.move_to_next());
if ( (uint16_t) last->flags & CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS) if ( (uint16_t) last->flags & CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS)
*instruction_start = start_offset + ((char *) last - (char *) glyf_table->dataX) + last->get_size(); *instruction_start = ((char *) last - (char *) glyf_table->dataX) + last->get_size();
else else
*instruction_start = end_offset; *instruction_start = end_offset;
*instruction_end = end_offset; *instruction_end = end_offset;

View File

@ -143,12 +143,11 @@ test_subset_glyf_strip_hints_simple (void)
hb_face_destroy (face_ac); hb_face_destroy (face_ac);
} }
// TODO(rsheeter): test strip hints from composite
static void static void
test_subset_glyf_strip_hints_composite (void) test_subset_glyf_strip_hints_composite (void)
{ {
hb_face_t *face_components = hb_subset_test_open_font ("fonts/Roboto-Regular.components.ttf"); hb_face_t *face_components = hb_subset_test_open_font ("fonts/Roboto-Regular.components.ttf");
hb_face_t *face_subset = hb_subset_test_open_font ("fonts/Roboto-Regular.components.subset.ttf"); hb_face_t *face_subset = hb_subset_test_open_font ("fonts/Roboto-Regular.components.1fc.nohints.ttf");
hb_set_t *codepoints = hb_set_create(); hb_set_t *codepoints = hb_set_create();
hb_set_add (codepoints, 0x1fc); hb_set_add (codepoints, 0x1fc);
@ -160,7 +159,7 @@ test_subset_glyf_strip_hints_composite (void)
hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('g','l','y','f')); hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('g','l','y','f'));
hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('l','o','c', 'a')); hb_subset_test_check (face_subset, face_generated_subset, HB_TAG ('l','o','c', 'a'));
check_maxp_num_glyphs(face_generated_subset, 4); check_maxp_num_glyphs(face_generated_subset, 4, false);
hb_face_destroy (face_generated_subset); hb_face_destroy (face_generated_subset);
hb_face_destroy (face_subset); hb_face_destroy (face_subset);