From ffcb5cbf71b312cdd4606a3285e10e201ff5bccd Mon Sep 17 00:00:00 2001 From: Rod Sheeter Date: Tue, 27 Feb 2018 20:17:04 -0800 Subject: [PATCH] [subset] update the test file for composite, fix an offset calculation --- src/hb-ot-glyf-table.hh | 2 +- .../Roboto-Regular.components.1fc.nohints.ttf | Bin 0 -> 932 bytes test/api/test-subset-glyf.c | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 test/api/fonts/Roboto-Regular.components.1fc.nohints.ttf diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 53360182..e4d3ec85 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -412,7 +412,7 @@ struct glyf } while (composite_it.move_to_next()); 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 *instruction_start = end_offset; *instruction_end = end_offset; diff --git a/test/api/fonts/Roboto-Regular.components.1fc.nohints.ttf b/test/api/fonts/Roboto-Regular.components.1fc.nohints.ttf new file mode 100644 index 0000000000000000000000000000000000000000..d36cc81601e000d07b2c1813440424a01eed097e GIT binary patch literal 932 zcmZvaO-NKx6vzMfzW3(M4AV%OL#62q4nms}4T*3OlQ|UDh#I!jmyR>o8y$2MKQ>{} zsz`_^ByiE9O^`dIMHI9ssD)7*A&5SpMM0QB$jrR{_r1Y|bT8-L^E)5+o_n|u0K&Ke z4MWM!(_J_PAE3o)ZBF*2`Z{O2r^(&qXtM7@;&$y~glv=BQ+-EUXM$HB0@6<&8qQgH z9P&LQXUP{c)>IyT)G&TOIh3*IMjPW_9#Q{6xt2{^BgL_I^MJTdZqL#Xd}=%(eDthSOcKr z79!|};Svp%;j3_%Z%ojpVr5hH;L>+{u&Uz^4yZN*FMsVlqV^A>cWb+@^dZpVpCSg_ zd#GqPFd`SRV9q<6stR?EX_rF`IkR0?J{xG+b+77&re9}Q4Zv77+L+Sl?bd*+*d1T$ZZUE6S~(U_Yar?Dvk;Q)5L?dysnv`w``?bJ8w~j^nLm z_KbG^9CxjESGttf6ZcGs26dtyphrb|y5z48p%)XlL@7{ukwym7uwh}+&1A4MrvAr& zhTxO^{1p!WgVMv5mx-mpu4YdaOt_FzCuI_&3>&mR&;||Z?ieu1S|H0w8 VNgMIZWco7VwpAEMd{>5>_7BTOo=X4# literal 0 HcmV?d00001 diff --git a/test/api/test-subset-glyf.c b/test/api/test-subset-glyf.c index 1caa5269..8e17e8d5 100644 --- a/test/api/test-subset-glyf.c +++ b/test/api/test-subset-glyf.c @@ -143,12 +143,11 @@ test_subset_glyf_strip_hints_simple (void) hb_face_destroy (face_ac); } -// TODO(rsheeter): test strip hints from composite static 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_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_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 ('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_subset); -- GitLab