From fbbd926dba163d9a2a6a62f380951f03363c2b14 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 11 Oct 2018 01:22:29 -0400 Subject: [PATCH] [kerx] Implement Format4 action_type=1 contour-point-based attachment Untested. This concludes kerx table support! --- src/hb-aat-layout-kerx-table.hh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index a54e297..cd11291 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -354,7 +354,22 @@ struct KerxSubTableFormat4 return false; HB_UNUSED unsigned int markControlPoint = *data++; HB_UNUSED unsigned int currControlPoint = *data++; - /* TODO */ + hb_position_t markX = 0; + hb_position_t markY = 0; + hb_position_t currX = 0; + hb_position_t currY = 0; + if (!c->font->get_glyph_contour_point_for_origin (c->buffer->info[mark].codepoint, + markControlPoint, + HB_DIRECTION_LTR /*XXX*/, + &markX, &markY) || + !c->font->get_glyph_contour_point_for_origin (c->buffer->cur ().codepoint, + currControlPoint, + HB_DIRECTION_LTR /*XXX*/, + &currX, &currY)) + return true; /* True, such that the machine continues. */ + + o.x_offset = markX - currX; + o.y_offset = markY - currY; } break; -- 2.7.4