Disable fallback mark positioning if kern table has cross-stream kerning
Happens even if the cross-stream kerning is for cursive attachment only. Oh well..
This commit is contained in:
parent
5cf6f94dfd
commit
ca23567f41
|
@ -63,6 +63,12 @@ hb_ot_layout_has_kerning (hb_face_t *face)
|
||||||
return face->table.kern->has_data ();
|
return face->table.kern->has_data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hb_bool_t
|
||||||
|
hb_ot_layout_has_cross_kerning (hb_face_t *face)
|
||||||
|
{
|
||||||
|
return face->table.kern->has_cross_stream ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
hb_ot_layout_kern (hb_ot_shape_plan_t *plan,
|
hb_ot_layout_kern (hb_ot_shape_plan_t *plan,
|
||||||
hb_font_t *font,
|
hb_font_t *font,
|
||||||
|
|
|
@ -48,6 +48,9 @@ struct hb_ot_shape_plan_t;
|
||||||
HB_INTERNAL hb_bool_t
|
HB_INTERNAL hb_bool_t
|
||||||
hb_ot_layout_has_kerning (hb_face_t *face);
|
hb_ot_layout_has_kerning (hb_face_t *face);
|
||||||
|
|
||||||
|
HB_INTERNAL hb_bool_t
|
||||||
|
hb_ot_layout_has_cross_kerning (hb_face_t *face);
|
||||||
|
|
||||||
HB_INTERNAL void
|
HB_INTERNAL void
|
||||||
hb_ot_layout_kern (hb_ot_shape_plan_t *plan,
|
hb_ot_layout_kern (hb_ot_shape_plan_t *plan,
|
||||||
hb_font_t *font,
|
hb_font_t *font,
|
||||||
|
|
|
@ -131,13 +131,12 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
|
||||||
plan.apply_kerx = true;
|
plan.apply_kerx = true;
|
||||||
else if (hb_ot_layout_has_kerning (face))
|
else if (hb_ot_layout_has_kerning (face))
|
||||||
plan.apply_kern = true;
|
plan.apply_kern = true;
|
||||||
else
|
|
||||||
plan.fallback_kerning = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool has_kern_mark = plan.apply_kern && hb_ot_layout_has_cross_kerning (face);
|
||||||
|
plan.zero_marks = !plan.apply_kerx && !has_kern_mark;
|
||||||
plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
|
plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
|
||||||
if (!plan.apply_gpos && !plan.apply_kerx)
|
plan.fallback_mark_positioning = !plan.apply_gpos && !plan.apply_kerx && !has_kern_mark;
|
||||||
plan.fallback_mark_positioning = true;
|
|
||||||
|
|
||||||
/* Currently we always apply trak. */
|
/* Currently we always apply trak. */
|
||||||
plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face);
|
plan.apply_trak = plan.requested_tracking && hb_aat_layout_has_tracking (face);
|
||||||
|
@ -853,7 +852,7 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c)
|
||||||
|
|
||||||
hb_ot_layout_position_start (c->font, c->buffer);
|
hb_ot_layout_position_start (c->font, c->buffer);
|
||||||
|
|
||||||
if (!c->plan->apply_kerx)
|
if (c->plan->zero_marks)
|
||||||
switch (c->plan->shaper->zero_width_marks)
|
switch (c->plan->shaper->zero_width_marks)
|
||||||
{
|
{
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
|
||||||
|
@ -866,20 +865,19 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX Clean up relationship between these. */
|
|
||||||
if (c->plan->apply_gpos)
|
if (c->plan->apply_gpos)
|
||||||
c->plan->position (c->font, c->buffer);
|
c->plan->position (c->font, c->buffer);
|
||||||
else if (c->plan->apply_kerx)
|
else if (c->plan->apply_kerx)
|
||||||
hb_aat_layout_position (c->plan, c->font, c->buffer);
|
hb_aat_layout_position (c->plan, c->font, c->buffer);
|
||||||
else if (c->plan->apply_kern)
|
else if (c->plan->apply_kern)
|
||||||
hb_ot_layout_kern (c->plan, c->font, c->buffer);
|
hb_ot_layout_kern (c->plan, c->font, c->buffer);
|
||||||
else if (c->plan->fallback_kerning)
|
else
|
||||||
_hb_ot_shape_fallback_kern (c->plan, c->font, c->buffer);
|
_hb_ot_shape_fallback_kern (c->plan, c->font, c->buffer);
|
||||||
|
|
||||||
if (c->plan->apply_trak)
|
if (c->plan->apply_trak)
|
||||||
hb_aat_layout_track (c->plan, c->font, c->buffer);
|
hb_aat_layout_track (c->plan, c->font, c->buffer);
|
||||||
|
|
||||||
if (!c->plan->apply_kerx)
|
if (c->plan->zero_marks)
|
||||||
switch (c->plan->shaper->zero_width_marks)
|
switch (c->plan->shaper->zero_width_marks)
|
||||||
{
|
{
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
|
||||||
|
|
|
@ -51,8 +51,8 @@ struct hb_ot_shape_plan_t
|
||||||
bool requested_tracking : 1;
|
bool requested_tracking : 1;
|
||||||
bool has_frac : 1;
|
bool has_frac : 1;
|
||||||
bool has_gpos_mark : 1;
|
bool has_gpos_mark : 1;
|
||||||
|
bool zero_marks : 1;
|
||||||
bool fallback_glyph_classes : 1;
|
bool fallback_glyph_classes : 1;
|
||||||
bool fallback_kerning : 1;
|
|
||||||
bool fallback_mark_positioning : 1;
|
bool fallback_mark_positioning : 1;
|
||||||
|
|
||||||
bool apply_gpos : 1;
|
bool apply_gpos : 1;
|
||||||
|
|
Loading…
Reference in New Issue