From cf71d28c380819cb0f7f0f22f6ff9e4aa881a2b8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 27 May 2014 17:47:43 -0400 Subject: [PATCH] [indic/myanmar] Refactor a few macros --- src/hb-ot-shape-complex-indic-private.hh | 12 ++++++++++++ src/hb-ot-shape-complex-indic.cc | 10 ---------- src/hb-ot-shape-complex-myanmar.cc | 6 ------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh index fe8b2074..beabe0d4 100644 --- a/src/hb-ot-shape-complex-indic-private.hh +++ b/src/hb-ot-shape-complex-indic-private.hh @@ -64,6 +64,18 @@ enum indic_category_t { OT_CM2 = 31 /* Consonant-Medial, second slot. */ }; +#define MEDIAL_FLAGS (FLAG (OT_CM) | FLAG (OT_CM2)) + +/* Note: + * + * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels + * cannot happen in a consonant syllable. The plus side however is, we can call the + * consonant syllable logic from the vowel syllable function and get it all right! */ +#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE)) +#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ)) +#define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng)) + + /* Visual positions in a syllable from left to right. */ enum indic_position_t { POS_START, diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 6f51a797..7f1606cc 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -145,28 +145,18 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags) return !!(FLAG (info.indic_category()) & flags); } -#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ)) static inline bool is_joiner (const hb_glyph_info_t &info) { return is_one_of (info, JOINER_FLAGS); } -#define MEDIAL_FLAGS (FLAG (OT_CM) | FLAG (OT_CM2)) - -/* Note: - * - * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels - * cannot happen in a consonant syllable. The plus side however is, we can call the - * consonant syllable logic from the vowel syllable function and get it all right! */ -#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_DOTTEDCIRCLE)) static inline bool is_consonant (const hb_glyph_info_t &info) { return is_one_of (info, CONSONANT_FLAGS); } -#define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng)) static inline bool is_halant_or_coeng (const hb_glyph_info_t &info) { diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc index 50209ffb..3c540f33 100644 --- a/src/hb-ot-shape-complex-myanmar.cc +++ b/src/hb-ot-shape-complex-myanmar.cc @@ -157,12 +157,6 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags) return !!(FLAG (info.myanmar_category()) & flags); } -/* Note: - * - * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels - * cannot happen in a consonant syllable. The plus side however is, we can call the - * consonant syllable logic from the vowel syllable function and get it all right! */ -#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CM) | FLAG (OT_Ra) | FLAG (OT_V) | FLAG (OT_NBSP) | FLAG (OT_GB)) static inline bool is_consonant (const hb_glyph_info_t &info) { -- GitLab