#define indic_category() complex_var_u8_0() /* indic_category_t */
#define indic_position() complex_var_u8_1() /* indic_position_t */
+static inline bool
+is_one_of (const hb_glyph_info_t &info, unsigned int flags)
+{
+ /* If it ligated, all bets are off. */
+ if (_hb_glyph_info_ligated (&info)) return false;
+ return !!(FLAG_UNSAFE (info.indic_category()) & flags);
+}
+
+static inline bool
+is_joiner (const hb_glyph_info_t &info)
+{
+ return is_one_of (info, JOINER_FLAGS);
+}
+
+static inline bool
+is_consonant (const hb_glyph_info_t &info)
+{
+ return is_one_of (info, CONSONANT_FLAGS);
+}
+
+static inline bool
+is_halant (const hb_glyph_info_t &info)
+{
+ return is_one_of (info, FLAG (OT_H));
+}
#define IN_HALF_BLOCK(u, Base) (((u) & ~0x7Fu) == (Base))
)
static inline indic_position_t
-matra_position (hb_codepoint_t u, indic_position_t side)
+matra_position_indic (hb_codepoint_t u, indic_position_t side)
{
switch ((int) side)
{
}
else if (cat == OT_M)
{
- pos = matra_position (u, pos);
+ pos = matra_position_indic (u, pos);
}
else if ((FLAG_UNSAFE (cat) & (FLAG (OT_SM) /* | FLAG (OT_VD) */ | FLAG (OT_A) | FLAG (OT_Symbol))))
{
*/
-static inline bool
-is_one_of (const hb_glyph_info_t &info, unsigned int flags)
-{
- /* If it ligated, all bets are off. */
- if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG_UNSAFE (info.indic_category()) & flags);
-}
-
-static inline bool
-is_joiner (const hb_glyph_info_t &info)
-{
- return is_one_of (info, JOINER_FLAGS);
-}
-
-static inline bool
-is_consonant (const hb_glyph_info_t &info)
-{
- return is_one_of (info, CONSONANT_FLAGS);
-}
-
-static inline bool
-is_halant (const hb_glyph_info_t &info)
-{
- return is_one_of (info, FLAG (OT_H));
-}
-
-
/*
* Indic configurations. Note that we do not want to keep every single script-specific
* behavior in these tables necessarily. This should mainly be used for per-script
#include "hb-ot-layout-private.hh"
/* buffer var allocations */
-#define khmer_category() complex_var_u8_0() /* khmer_category_t */
-#define khmer_position() complex_var_u8_1() /* khmer_position_t */
+#define khmer_category() indic_category() /* khmer_category_t */
+#define khmer_position() indic_position() /* khmer_position_t */
/*
static inline khmer_position_t
-matra_position (khmer_position_t side)
+matra_position_khmer (khmer_position_t side)
{
switch ((int) side)
{
}
static inline bool
-is_one_of (const hb_glyph_info_t &info, unsigned int flags)
-{
- /* If it ligated, all bets are off. */
- if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG_UNSAFE (info.khmer_category()) & flags);
-}
-
-static inline bool
-is_joiner (const hb_glyph_info_t &info)
-{
- return is_one_of (info, JOINER_FLAGS);
-}
-
-static inline bool
-is_consonant (const hb_glyph_info_t &info)
+is_consonant_or_vowel (const hb_glyph_info_t &info)
{
return is_one_of (info, CONSONANT_FLAGS | FLAG (OT_V));
}
}
else if (cat == OT_M)
{
- pos = matra_position (pos);
+ pos = matra_position_khmer (pos);
}
else if ((FLAG_UNSAFE (cat) & (FLAG (OT_SM) | FLAG (OT_A) | FLAG (OT_Symbol))))
{
/* Mark all subsequent consonants as below. */
for (unsigned int i = base + 1; i < end; i++)
- if (is_consonant (info[i]))
+ if (is_consonant_or_vowel (info[i]))
info[i].khmer_position() = POS_BELOW_C;
/* Mark final consonants. A final consonant is one appearing after a matra,
for (unsigned int i = base + 1; i < end; i++)
if (info[i].khmer_category() == OT_M) {
for (unsigned int j = i + 1; j < end; j++)
- if (is_consonant (info[j])) {
+ if (is_consonant_or_vowel (info[j])) {
info[j].khmer_position() = POS_FINAL_C;
break;
}
{
unsigned int last = base;
for (unsigned int i = base + 1; i < end; i++)
- if (is_consonant (info[i]))
+ if (is_consonant_or_vowel (info[i]))
{
for (unsigned int j = last + 1; j < i; j++)
if (info[j].khmer_position() < POS_SMVD)
#include "hb-ot-shape-complex-indic-private.hh"
/* buffer var allocations */
-#define myanmar_category() complex_var_u8_0() /* myanmar_category_t */
-#define myanmar_position() complex_var_u8_1() /* myanmar_position_t */
+#define myanmar_category() indic_category() /* myanmar_category_t */
+#define myanmar_position() indic_position() /* myanmar_position_t */
/*
};
-static inline bool
-is_one_of (const hb_glyph_info_t &info, unsigned int flags)
-{
- /* If it ligated, all bets are off. */
- if (_hb_glyph_info_ligated (&info)) return false;
- return !!(FLAG_UNSAFE (info.myanmar_category()) & flags);
-}
-
-static inline bool
-is_consonant (const hb_glyph_info_t &info)
-{
- return is_one_of (info, CONSONANT_FLAGS);
-}
-
-
static inline void
set_myanmar_properties (hb_glyph_info_t &info)
{