From 540ccc38b0f95804d08047f8b2d059bfd1e09337 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 Nov 2018 10:33:46 -0500 Subject: [PATCH] [kern/kerx] More towards sharing --- src/hb-aat-layout-kerx-table.hh | 7 ++++--- src/hb-ot-kern-table.hh | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 11d7f5c..a2f0c64 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -59,6 +59,8 @@ kerxTupleKern (int value, struct KerxSubTableHeader { + typedef MorxTypes Types; + enum Coverage { Vertical = 0x80000000, /* Set if table has vertical kerning values. */ @@ -134,13 +136,12 @@ struct KerxSubTableFormat0 inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (likely (c->check_struct (this) && - pairs.sanitize (c))); + return_trace (likely (pairs.sanitize (c))); } protected: KernSubTableHeader header; - BinSearchArrayOf + BinSearchArrayOf pairs; /* Sorted kern records. */ public: DEFINE_SIZE_ARRAY (KernSubTableHeader::static_size + 16, pairs); diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 40d36a3..9f75466 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -49,8 +49,7 @@ struct KernSubTableFormat0 { hb_glyph_pair_t pair = {left, right}; int i = pairs.bsearch (pair); - if (i == -1) - return 0; + if (i == -1) return 0; return pairs[i].get_kerning (); } @@ -78,7 +77,8 @@ struct KernSubTableFormat0 protected: KernSubTableHeader header; - BinSearchArrayOf pairs; /* Array of kerning pairs. */ + BinSearchArrayOf + pairs; /* Array of kerning pairs. */ public: DEFINE_SIZE_ARRAY (KernSubTableHeader::static_size + 8, pairs); }; @@ -543,6 +543,8 @@ struct KernOT : KernTable struct SubTableHeader { + typedef AAT::MortTypes Types; + enum Coverage { Direction = 0x01u, @@ -586,6 +588,8 @@ struct KernAAT : KernTable struct SubTableHeader { + typedef AAT::MortTypes Types; + enum Coverage { Direction = 0x80u, -- 2.7.4