diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 8b87e176ffd03d37ff77af3dfca7cac6492f19ee..aabbd4c980ba1224c2662c0c674f5523c232e261 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -314,7 +314,7 @@ struct KerxSubTableFormat1 v = 0; } - if (idx < buffer->len && buffer->info[idx].mask & kern_mask) + if (idx < buffer->len) { if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) { @@ -324,7 +324,7 @@ struct KerxSubTableFormat1 if (!buffer->pos[idx].y_offset) buffer->pos[idx].y_offset += c->font->em_scale_y (crossOffset); } - else + else if (buffer->info[idx].mask & kern_mask) { if (!buffer->pos[idx].x_offset) { @@ -342,7 +342,7 @@ struct KerxSubTableFormat1 if (!buffer->pos[idx].x_offset) buffer->pos[idx].x_offset = c->font->em_scale_x (crossOffset); } - else + else if (buffer->info[idx].mask & kern_mask) { if (!buffer->pos[idx].y_offset) { @@ -375,7 +375,8 @@ struct KerxSubTableFormat1 { TRACE_APPLY (this); - if (!c->plan->requested_kerning) + if (!c->plan->requested_kerning && + !(header.coverage & header.CrossStream)) return false; driver_context_t dc (this, c); diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index d2f77132079e9c42e0b0310ad2d6e61ccafb6f53..bc4c24980e1eecd6454cef77d02448fc683f3bf2 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -124,7 +124,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan, else if (hb_aat_layout_has_positioning (face)) plan.apply_kerx = true; - if (plan.requested_kerning && !plan.apply_kerx && !has_gpos_kern) + if (!plan.apply_kerx && !has_gpos_kern) { /* Apparently Apple applies kerx if GPOS kern was not applied. */ if (hb_aat_layout_has_positioning (face))