From 80e3102b8a216f9a751d073f9a2f7900ca758086 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 8 Oct 2018 22:41:08 -0400 Subject: [PATCH] [kerx] Process coverage flags --- src/hb-aat-layout-kerx-table.hh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 9693af32b..db6bba4a7 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -212,6 +212,8 @@ struct KerxSubTableFormat6 struct KerxTable { + friend kerx; + inline unsigned int get_size (void) const { return length; } inline unsigned int get_type (void) const { return coverage & SubtableType; } @@ -304,7 +306,32 @@ struct kerx unsigned int count = tableCount; for (unsigned int i = 0; i < count; i++) { + bool reverse; + + if (HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != + bool (table->coverage & KerxTable::Vertical)) + goto skip; + + if (table->coverage & KerxTable::CrossStream) + goto skip; /* We do NOT handle cross-stream kerning. */ + + reverse = bool (table->coverage & KerxTable::ProcessDirection) != + HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction); + + if (!c->buffer->message (c->font, "start kerx subtable %d", c->lookup_index)) + goto skip; + + if (reverse) + c->buffer->reverse (); + table->dispatch (c); + + if (reverse) + c->buffer->reverse (); + + (void) c->buffer->message (c->font, "end kerx subtable %d", c->lookup_index); + + skip: table = &StructAfter (*table); } }