diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index a395e76ab..9a221bc5a 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -769,6 +769,7 @@ struct KerxSubTableHeader typedef ExtendedTypes Types; inline unsigned int tuple_count (void) const { return tupleCount; } + inline bool is_horizontal (void) const { return !(coverage & Vertical); } enum Coverage { @@ -863,8 +864,7 @@ struct kerx { bool reverse; - if (HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) != - bool (st->u.header.coverage & st->u.header.Vertical)) + if (HB_DIRECTION_IS_HORIZONTAL (c->buffer->props.direction) != st->u.header.is_horizontal ()) goto skip; reverse = bool (st->u.header.coverage & st->u.header.Backwards) != diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index f8b1aa7a5..89da9e36f 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -173,9 +173,8 @@ struct KernTable unsigned int count = thiz()->nTables; for (unsigned int i = 0; i < count; i++) { - if ((st->u.header.coverage & - (st->u.header.Variation | st->u.header.CrossStream | st->u.header.Direction)) != - st->u.header.DirectionHorizontal) + if ((st->u.header.coverage & (st->u.header.Variation | st->u.header.CrossStream)) || + !st->u.header.is_horizontal ()) continue; v += st->get_kerning (left, right); st = &StructAfter (*st); @@ -196,8 +195,7 @@ struct KernTable if (st->u.header.coverage & st->u.header.Variation) goto skip; - if (HB_DIRECTION_IS_HORIZONTAL (c->buffer->props.direction) != - ((st->u.header.coverage & st->u.header.Direction) == st->u.header.DirectionHorizontal)) + if (HB_DIRECTION_IS_HORIZONTAL (c->buffer->props.direction) != st->u.header.is_horizontal ()) goto skip; if (!c->buffer->message (c->font, "start kern subtable %d", c->lookup_index)) @@ -248,18 +246,16 @@ struct KernOT : KernTable typedef AAT::ObsoleteTypes Types; inline unsigned int tuple_count (void) const { return 0; } - + inline bool is_horizontal (void) const { return (coverage & Horizontal); } enum Coverage { - Direction = 0x01u, + Horizontal = 0x01u, Minimum = 0x02u, CrossStream = 0x04u, Override = 0x08u, Variation = 0x00u, /* Not supported. */ - - DirectionHorizontal= 0x01u }; inline bool sanitize (hb_sanitize_context_t *c) const @@ -296,14 +292,13 @@ struct KernAAT : KernTable typedef AAT::ObsoleteTypes Types; inline unsigned int tuple_count (void) const { return 0; } + inline bool is_horizontal (void) const { return !(coverage & Vertical); } enum Coverage { - Direction = 0x80u, + Vertical = 0x80u, CrossStream = 0x40u, Variation = 0x20u, - - DirectionHorizontal= 0x00u }; inline bool sanitize (hb_sanitize_context_t *c) const