diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 246936db3..01286d03f 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -151,7 +151,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, bool has_gsub = hb_ot_layout_has_substitution (face); bool has_gpos = !disable_gpos && hb_ot_layout_has_positioning (face); - if (0) + if (false) ; #ifndef HB_NO_AAT_SHAPE else if (hb_aat_layout_has_positioning (face) && !(has_gsub && has_gpos)) @@ -174,6 +174,8 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, #endif } + plan.apply_fallback_kern = !(plan.apply_gpos || plan.apply_kerx || plan.apply_kern); + plan.zero_marks = script_zero_marks && !plan.apply_kerx && (!plan.apply_kern @@ -274,11 +276,12 @@ hb_ot_shape_plan_t::position (hb_font_t *font, else if (this->apply_kerx) hb_aat_layout_position (this, font, buffer); #endif + #ifndef HB_NO_OT_KERN - else if (this->apply_kern) + if (this->apply_kern) hb_ot_layout_kern (this, font, buffer); #endif - else + else if (this->apply_fallback_kern) _hb_ot_shape_fallback_kern (this, font, buffer); #ifndef HB_NO_AAT_SHAPE diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh index acc98772a..e8c81015c 100644 --- a/src/hb-ot-shape.hh +++ b/src/hb-ot-shape.hh @@ -112,6 +112,7 @@ struct hb_ot_shape_plan_t #else static constexpr bool apply_kern = false; #endif + bool apply_fallback_kern : 1; #ifndef HB_NO_AAT_SHAPE bool apply_kerx : 1; bool apply_morx : 1; diff --git a/test/shaping/data/in-house/Makefile.sources b/test/shaping/data/in-house/Makefile.sources index 39cc8d658..ae48a776a 100644 --- a/test/shaping/data/in-house/Makefile.sources +++ b/test/shaping/data/in-house/Makefile.sources @@ -53,6 +53,7 @@ TESTS = \ tests/tibetan-contractions-1.tests \ tests/tibetan-contractions-2.tests \ tests/tibetan-vowels.tests \ + tests/tt-kern-gpos.tests \ tests/use-indic3.tests \ tests/use-marchen.tests \ tests/use-syllable.tests \ diff --git a/test/shaping/data/in-house/fonts/b121d4306b2e3add5abbaad21d95fcf04aacbd64.ttf b/test/shaping/data/in-house/fonts/b121d4306b2e3add5abbaad21d95fcf04aacbd64.ttf new file mode 100644 index 000000000..707559247 Binary files /dev/null and b/test/shaping/data/in-house/fonts/b121d4306b2e3add5abbaad21d95fcf04aacbd64.ttf differ diff --git a/test/shaping/data/in-house/meson.build b/test/shaping/data/in-house/meson.build index 474a789f4..c98a90de6 100644 --- a/test/shaping/data/in-house/meson.build +++ b/test/shaping/data/in-house/meson.build @@ -53,6 +53,7 @@ in_house_tests = [ 'tibetan-contractions-1.tests', 'tibetan-contractions-2.tests', 'tibetan-vowels.tests', + 'tt-kern-gpos.tests', 'use-indic3.tests', 'use-marchen.tests', 'use-syllable.tests', diff --git a/test/shaping/data/in-house/tests/tt-kern-gpos.tests b/test/shaping/data/in-house/tests/tt-kern-gpos.tests new file mode 100644 index 000000000..78296aee2 --- /dev/null +++ b/test/shaping/data/in-house/tests/tt-kern-gpos.tests @@ -0,0 +1 @@ +../fonts/b121d4306b2e3add5abbaad21d95fcf04aacbd64.ttf::U+0041,U+0043,U+0041,U+0042:[A=0+1275|C=1@-20,0+1272|A=2+1296|B=3+1327]