From f7c45bc33ec1559c960a039b770d5c37bd82f057 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 10 Oct 2018 22:15:13 -0400 Subject: [PATCH] [kerx] Allow granularly disabling kerning --- src/hb-aat-layout-kerx-table.hh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 881ab4e35..a96bad17e 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -162,6 +162,7 @@ struct KerxSubTableFormat1 return false; } + hb_mask_t kern_mask = c->plan->kern_mask; for (unsigned int i = 0; i < depth; i++) { /* Apparently, when spec says "Each pops one glyph from the kerning stack @@ -170,11 +171,14 @@ struct KerxSubTableFormat1 * list. Discovered by testing. */ unsigned int idx = stack[i]; int v = *actions++; - /* XXX Non-forward direction... */ - if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) - buffer->pos[idx].x_advance += c->font->em_scale_x (v); - else - buffer->pos[idx].y_advance += c->font->em_scale_y (v); + if (buffer->info[idx].mask & kern_mask) + { + /* XXX Non-forward direction... */ + if (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction)) + buffer->pos[idx].x_advance += c->font->em_scale_x (v); + else + buffer->pos[idx].y_advance += c->font->em_scale_y (v); + } } depth = 0; }