From: Behdad Esfahbod Date: Wed, 31 Oct 2018 07:15:00 +0000 (-0700) Subject: [mort] Some Ligature work X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=431c6e496be56e441ee4b9b705f40a1246bdd0d6;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [mort] Some Ligature work --- diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index c3a7483..cc83987 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -359,19 +359,43 @@ struct ContextualSubtable DEFINE_SIZE_STATIC (20); }; -template -struct LigatureSubtable -{ - typedef typename Types::HBUINT HBUINT; - struct EntryData +template +struct LigatureEntry; + +template <> +struct LigatureEntry +{ + typedef struct { HBUINT16 ligActionIndex; /* Index to the first ligActionTable entry * for processing this group, if indicated * by the flags. */ public: DEFINE_SIZE_STATIC (2); - }; + } EntryData; + + template + static inline unsigned int ligActionIndex (Entry &entry, Flags flags) + { return entry->data.ligActionIndex; }; +}; +template <> +struct LigatureEntry +{ + typedef void EntryData; + + template + static inline unsigned int ligActionIndex (Entry &entry, Flags flags) + { return flags & 0x3FFF; }; +}; + + +template +struct LigatureSubtable +{ + typedef typename Types::HBUINT HBUINT; + + typedef typename LigatureEntry::EntryData EntryData; struct driver_context_t { @@ -436,7 +460,7 @@ struct LigatureSubtable { DEBUG_MSG (APPLY, nullptr, "Perform action with %d", match_length); unsigned int end = buffer->out_len; - unsigned int action_idx = entry->data.ligActionIndex; + unsigned int action_idx = LigatureEntry::ligActionIndex (entry, flags); unsigned int action; unsigned int ligature_idx = 0;