[ot-shape] Fix application of kern table if GPOS kern is missing

Was broken sometime after we implemented kerx and tweaking it.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3043
This commit is contained in:
Behdad Esfahbod 2021-07-16 15:06:10 -06:00
parent 1060b04938
commit 79e8b30609
6 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 \

View File

@ -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',

View File

@ -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]