diff --git a/test/shaping/data/aots/hb-aots-tester.cpp b/test/shaping/data/aots/hb-aots-tester.cpp index 72db93e72..d64ed0883 100644 --- a/test/shaping/data/aots/hb-aots-tester.cpp +++ b/test/shaping/data/aots/hb-aots-tester.cpp @@ -25,6 +25,8 @@ static const bool verbose = true; hb_feature_t *gFeatures; +hb_font_t *gFont; +hb_face_t *gFace; int gNbFeatures; hb_buffer_t *runTest(const char *testName, @@ -94,13 +96,15 @@ int gNbFeatures; } gFeatures = features; gNbFeatures = nbFeatures; + gFont = font; + gFace = face; // shape hb_shape(font, buffer, features, nbFeatures); hb_blob_destroy(blob); - hb_font_destroy(font); - hb_face_destroy(face); + //hb_font_destroy(font); + //hb_face_destroy(face); //free(features); return buffer; @@ -314,9 +318,9 @@ bool gpos_test(const char *testName, actualX[i] = curX + pos[i].x_offset; actualY[i] = curY + pos[i].y_offset; - actualX[i] -= 1500 * i; - curX += pos[i].x_advance; + if (hb_ot_layout_get_glyph_class (gFace, actualG[i]) != HB_OT_LAYOUT_GLYPH_CLASS_MARK) + curX -= 1500; curY += pos[i].y_advance; } @@ -387,14 +391,17 @@ bool gpos_test(const char *testName, } fprintf (tests_file, ":["); + int accumlatedAdvance = 0; for (unsigned int i = 0; i < nbActual; i++) { if (i != 0) fprintf (tests_file, "|"); fprintf (tests_file, "%d", /*it should be "out[i]"*/ actualG[i]); - int expected_x = x[i] + 1500*i; + int expected_x = x[i] + accumlatedAdvance; int expected_y = y[i]; if (expected_x || expected_y) fprintf (tests_file, "@%d,%d", expected_x, expected_y); + if (hb_ot_layout_get_glyph_class (gFace, actualG[i]) != HB_OT_LAYOUT_GLYPH_CLASS_MARK) + accumlatedAdvance += 1500; } fprintf (tests_file, "]"); diff --git a/test/shaping/data/aots/tests/gpos4_lookupflag.tests b/test/shaping/data/aots/tests/gpos4_lookupflag.tests index 9d041bff2..198e57c83 100644 --- a/test/shaping/data/aots/tests/gpos4_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos4_lookupflag.tests @@ -1,2 +1,2 @@ -#../fonts/gpos4_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0011,U+0013,U+0011:[17|18@1500,0|17@3000,0|19@4500,0|17@6000,0] -#../fonts/gpos4_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@3000,0|17@4500,0] +../fonts/gpos4_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0011,U+0013,U+0011:[17|18@1500,0|17@3000,0|19@4500,0|17@4500,0] +../fonts/gpos4_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@3000,0|17@3000,0] diff --git a/test/shaping/data/aots/tests/gpos4_multiple_anchors.tests b/test/shaping/data/aots/tests/gpos4_multiple_anchors.tests index af9a1f5fa..54e92beba 100644 --- a/test/shaping/data/aots/tests/gpos4_multiple_anchors.tests +++ b/test/shaping/data/aots/tests/gpos4_multiple_anchors.tests @@ -1 +1 @@ -#../fonts/gpos4_multiple_anchors_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0013,U+0014,U+0015,U+0016,U+0012,U+0013,U+0014,U+0015,U+0016:[17|19@-100,-80|20@-91,-71|21@-102,-82|22@-93,-73|18@7500,0|19@7420,-60|20@7429,-51|21@7418,-62|22@7427,-53] +#../fonts/gpos4_multiple_anchors_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0013,U+0014,U+0015,U+0016,U+0012,U+0013,U+0014,U+0015,U+0016:[17|19@-100,-80|20@-1591,-71|21@-3102,-82|22@-4593,-73|18@1500,0|19@1420,-60|20@-71,-51|21@-1582,-62|22@-3073,-53] diff --git a/test/shaping/data/aots/tests/gpos4_simple.tests b/test/shaping/data/aots/tests/gpos4_simple.tests index 5d605079d..7b5c46ff6 100644 --- a/test/shaping/data/aots/tests/gpos4_simple.tests +++ b/test/shaping/data/aots/tests/gpos4_simple.tests @@ -1,5 +1,5 @@ -#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@1400,-80|17@4500,0] -#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0011,U+0013,U+0011:[17|17@1500,0|19@3000,0|17@4500,0] -#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0019,U+0019,U+0013,U+0011:[25|25@1500,0|19@3000,0|17@4500,0] -#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0013,U+0011:[17|18@1500,0|19@1400,-80|19@1400,-80|17@6000,0] -#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0014,U+0013,U+0011:[17|18@1500,0|20@3000,0|19@1400,-80|17@6000,0] +#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@1400,-80|17@3000,0] +../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0011,U+0013,U+0011:[17|17@1500,0|19@3000,0|17@3000,0] +../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0019,U+0019,U+0013,U+0011:[25|25@1500,0|19@3000,0|17@3000,0] +#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0013,U+0011:[17|18@1500,0|19@1400,-80|19@-100,-80|17@3000,0] +#../fonts/gpos4_simple_1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0014,U+0013,U+0011:[17|18@1500,0|20@3000,0|19@-100,-80|17@3000,0] diff --git a/test/shaping/data/aots/tests/gpos5.tests b/test/shaping/data/aots/tests/gpos5.tests index a20a0b9ea..14885ed9d 100644 --- a/test/shaping/data/aots/tests/gpos5.tests +++ b/test/shaping/data/aots/tests/gpos5.tests @@ -1,2 +1,2 @@ -#../fonts/gpos5_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+001E,U+0013,U+001F,U+0011:[17|18@1500,0|19@1400,-80|17@4500,0] -#../fonts/gpos5_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+001E,U+001F,U+0013,U+0011:[17|18@1500,0|19@1401,-79|17@4500,0] +../fonts/gpos5_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+001E,U+0013,U+001F,U+0011:[17|18@1500,0|19@1400,-80|17@3000,0] +#../fonts/gpos5_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+001E,U+001F,U+0013,U+0011:[17|18@1500,0|19@1401,-79|17@3000,0] diff --git a/test/shaping/data/aots/tests/gpos6.tests b/test/shaping/data/aots/tests/gpos6.tests index e5f9b3cd5..1786bd60a 100644 --- a/test/shaping/data/aots/tests/gpos6.tests +++ b/test/shaping/data/aots/tests/gpos6.tests @@ -1,3 +1,3 @@ -#../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@1400,-80|17@4500,0] -#../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0011,U+0013,U+0011:[17|17@1500,0|19@3000,0|17@4500,0] -#../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0014,U+0014,U+0013,U+0011:[20|20@1500,0|19@3000,0|17@4500,0] +#../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0012,U+0013,U+0011:[17|18@1500,0|19@-100,-80|17@1500,0] +../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0011,U+0011,U+0013,U+0011:[17|17@1500,0|19@3000,0|17@3000,0] +../fonts/gpos6_font1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0014,U+0014,U+0013,U+0011:[20|20|19|17] diff --git a/test/shaping/data/aots/tests/gpos_chaining1_lookupflag.tests b/test/shaping/data/aots/tests/gpos_chaining1_lookupflag.tests index d0e6e2e0a..928352736 100644 --- a/test/shaping/data/aots/tests/gpos_chaining1_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_chaining1_lookupflag.tests @@ -1 +1 @@ -#../fonts/gpos_chaining1_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@4500,0|91@6000,0|22@7500,0|92@9000,0|23@10520,0|93@12000,0|94@13500,0|24@15000,0|90@16500,0|25@18000,0|91@19500,0|26@21000,0|0@22500,0] +../fonts/gpos_chaining1_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@3000,0|91@4500,0|22@4500,0|92@6000,0|23@6020,0|93@7500,0|94@7500,0|24@7500,0|90@9000,0|25@9000,0|91@10500,0|26@10500,0|0@12000,0] diff --git a/test/shaping/data/aots/tests/gpos_chaining2_lookupflag.tests b/test/shaping/data/aots/tests/gpos_chaining2_lookupflag.tests index 8b50e1499..640aad9bc 100644 --- a/test/shaping/data/aots/tests/gpos_chaining2_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_chaining2_lookupflag.tests @@ -1 +1 @@ -#../fonts/gpos_chaining2_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@4500,0|91@6000,0|22@7500,0|92@9000,0|23@10520,0|93@12000,0|94@13500,0|24@15000,0|90@16500,0|25@18000,0|91@19500,0|26@21000,0|0@22500,0] +../fonts/gpos_chaining2_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@3000,0|91@4500,0|22@4500,0|92@6000,0|23@6020,0|93@7500,0|94@7500,0|24@7500,0|90@9000,0|25@9000,0|91@10500,0|26@10500,0|0@12000,0] diff --git a/test/shaping/data/aots/tests/gpos_chaining3_lookupflag.tests b/test/shaping/data/aots/tests/gpos_chaining3_lookupflag.tests index 0165fb590..8b73b88b9 100644 --- a/test/shaping/data/aots/tests/gpos_chaining3_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_chaining3_lookupflag.tests @@ -1 +1 @@ -#../fonts/gpos_chaining3_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@4500,0|91@6000,0|22@7500,0|92@9000,0|23@10520,0|93@12000,0|94@13500,0|24@15000,0|90@16500,0|25@18000,0|91@19500,0|26@21000,0|0@22500,0] +../fonts/gpos_chaining3_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+0016,U+005C,U+0017,U+005D,U+005E,U+0018,U+005A,U+0019,U+005B,U+001A,U+0000:[0|20@1500,0|90@3000,0|21@3000,0|91@4500,0|22@4500,0|92@6000,0|23@6020,0|93@7500,0|94@7500,0|24@7500,0|90@9000,0|25@9000,0|91@10500,0|26@10500,0|0@12000,0] diff --git a/test/shaping/data/aots/tests/gpos_context1_lookupflag.tests b/test/shaping/data/aots/tests/gpos_context1_lookupflag.tests index 9e8fcd6e4..50e666e21 100644 --- a/test/shaping/data/aots/tests/gpos_context1_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_context1_lookupflag.tests @@ -1,2 +1,2 @@ -#../fonts/gpos_context1_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9020,0|0@10500,0] -#../fonts/gpos_context1_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9000,0|0@10500,0] +../fonts/gpos_context1_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4520,0|0@6000,0] +../fonts/gpos_context1_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4500,0|0@6000,0] diff --git a/test/shaping/data/aots/tests/gpos_context2_lookupflag.tests b/test/shaping/data/aots/tests/gpos_context2_lookupflag.tests index f48e82502..588e08186 100644 --- a/test/shaping/data/aots/tests/gpos_context2_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_context2_lookupflag.tests @@ -1,2 +1,2 @@ -#../fonts/gpos_context2_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9020,0|0@10500,0] -#../fonts/gpos_context2_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9000,0|0@10500,0] +../fonts/gpos_context2_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4520,0|0@6000,0] +../fonts/gpos_context2_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4500,0|0@6000,0] diff --git a/test/shaping/data/aots/tests/gpos_context3_lookupflag.tests b/test/shaping/data/aots/tests/gpos_context3_lookupflag.tests index 21f851b97..a6a0dc2c6 100644 --- a/test/shaping/data/aots/tests/gpos_context3_lookupflag.tests +++ b/test/shaping/data/aots/tests/gpos_context3_lookupflag.tests @@ -1,2 +1,2 @@ -#../fonts/gpos_context3_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9020,0|0@10500,0] -#../fonts/gpos_context3_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@4520,0|91@6000,0|92@7500,0|22@9000,0|0@10500,0] +../fonts/gpos_context3_lookupflag_f1.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1520,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4520,0|0@6000,0] +../fonts/gpos_context3_lookupflag_f2.otf:--features="test" --no-clusters --no-glyph-names --ned:U+0000,U+0014,U+005A,U+0015,U+005B,U+005C,U+0016,U+0000:[0|20@1500,0|90@3000,0|21@3020,0|91@4500,0|92@4500,0|22@4500,0|0@6000,0]