static void
-update_consonant_positions (const hb_ot_shape_plan_t *plan,
- hb_font_t *font,
- hb_buffer_t *buffer)
+update_consonant_positions_indic (const hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
{
const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data;
}
static void
-initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
+initial_reordering_syllable_indic (const hb_ot_shape_plan_t *plan,
+ hb_face_t *face,
+ hb_buffer_t *buffer,
+ unsigned int start, unsigned int end)
{
indic_syllable_type_t syllable_type = (indic_syllable_type_t) (buffer->info[start].syllable() & 0x0F);
switch (syllable_type)
}
static inline void
-insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font,
- hb_buffer_t *buffer)
+insert_dotted_circles_indic (const hb_ot_shape_plan_t *plan HB_UNUSED,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
{
if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE))
return;
hb_font_t *font,
hb_buffer_t *buffer)
{
- update_consonant_positions (plan, font, buffer);
- insert_dotted_circles (plan, font, buffer);
+ update_consonant_positions_indic (plan, font, buffer);
+ insert_dotted_circles_indic (plan, font, buffer);
foreach_syllable (buffer, start, end)
- initial_reordering_syllable (plan, font->face, buffer, start, end);
+ initial_reordering_syllable_indic (plan, font->face, buffer, start, end);
}
static void
-final_reordering_syllable (const hb_ot_shape_plan_t *plan,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
+final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan,
+ hb_buffer_t *buffer,
+ unsigned int start, unsigned int end)
{
const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data;
hb_glyph_info_t *info = buffer->info;
if (unlikely (!count)) return;
foreach_syllable (buffer, start, end)
- final_reordering_syllable (plan, buffer, start, end);
+ final_reordering_syllable_indic (plan, buffer, start, end);
HB_BUFFER_DEALLOCATE_VAR (buffer, indic_category);
HB_BUFFER_DEALLOCATE_VAR (buffer, indic_position);
OT_Ra = 16,
OT_CM = 17, /* Consonant-Medial. */
OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */
- OT_CS = 19
+ OT_CS = 19,
+
+ /* The following are used by Khmer & Myanmar shapers. Defined
+ * here for them to share. */
+ OT_VAbv = 26,
+ OT_VBlw = 27,
+ OT_VPre = 28,
+ OT_VPst = 29,
};
#define MEDIAL_FLAGS (FLAG (OT_CM))
}
static void
-initial_reordering_syllable (const hb_ot_shape_plan_t *plan,
- hb_face_t *face,
- hb_buffer_t *buffer,
- unsigned int start, unsigned int end)
+reorder_syllable_khmer (const hb_ot_shape_plan_t *plan,
+ hb_face_t *face,
+ hb_buffer_t *buffer,
+ unsigned int start, unsigned int end)
{
khmer_syllable_type_t syllable_type = (khmer_syllable_type_t) (buffer->info[start].syllable() & 0x0F);
switch (syllable_type)
}
static inline void
-insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font,
- hb_buffer_t *buffer)
+insert_dotted_circles_khmer (const hb_ot_shape_plan_t *plan HB_UNUSED,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
{
if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE))
return;
hb_font_t *font,
hb_buffer_t *buffer)
{
- insert_dotted_circles (plan, font, buffer);
+ insert_dotted_circles_khmer (plan, font, buffer);
foreach_syllable (buffer, start, end)
- initial_reordering_syllable (plan, font->face, buffer, start, end);
+ reorder_syllable_khmer (plan, font->face, buffer, start, end);
HB_BUFFER_DEALLOCATE_VAR (buffer, khmer_category);
}
OT_Robatic = 20,
OT_Xgroup = 21,
OT_Ygroup = 22,
-
- OT_VAbv = 26,
- OT_VBlw = 27,
- OT_VPre = 28,
- OT_VPst = 29,
+ //OT_VAbv = 26,
+ //OT_VBlw = 27,
+ //OT_VPre = 28,
+ //OT_VPst = 29,
};
static inline void
if (cat == (khmer_category_t) OT_M)
switch ((int) pos)
{
- case POS_PRE_C: cat = OT_VPre; break;
- case POS_BELOW_C: cat = OT_VBlw; break;
- case POS_ABOVE_C: cat = OT_VAbv; break;
- case POS_POST_C: cat = OT_VPst; break;
+ case POS_PRE_C: cat = (khmer_category_t) OT_VPre; break;
+ case POS_BELOW_C: cat = (khmer_category_t) OT_VBlw; break;
+ case POS_ABOVE_C: cat = (khmer_category_t) OT_VAbv; break;
+ case POS_POST_C: cat = (khmer_category_t) OT_VPst; break;
default: assert (0);
}
}
static inline void
-insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font,
- hb_buffer_t *buffer)
+insert_dotted_circles_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
{
if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE))
return;
hb_font_t *font,
hb_buffer_t *buffer)
{
- insert_dotted_circles (plan, font, buffer);
+ insert_dotted_circles_myanmar (plan, font, buffer);
foreach_syllable (buffer, start, end)
reorder_syllable_myanmar (plan, font->face, buffer, start, end);
OT_MW = 23, /* Various consonant medial types */
OT_MY = 24, /* Various consonant medial types */
OT_PT = 25, /* Pwo and other tones */
- OT_VAbv = 26,
- OT_VBlw = 27,
- OT_VPre = 28,
- OT_VPst = 29,
+ //OT_VAbv = 26,
+ //OT_VBlw = 27,
+ //OT_VPre = 28,
+ //OT_VPst = 29,
OT_VS = 30, /* Variation selectors */
OT_P = 31, /* Punctuation */
OT_D = 32, /* Digits except zero */
{
switch ((int) pos)
{
- case POS_PRE_C: cat = OT_VPre;
+ case POS_PRE_C: cat = (myanmar_category_t) OT_VPre;
pos = POS_PRE_M; break;
- case POS_ABOVE_C: cat = OT_VAbv; break;
- case POS_BELOW_C: cat = OT_VBlw; break;
- case POS_POST_C: cat = OT_VPst; break;
+ case POS_ABOVE_C: cat = (myanmar_category_t) OT_VAbv; break;
+ case POS_BELOW_C: cat = (myanmar_category_t) OT_VBlw; break;
+ case POS_POST_C: cat = (myanmar_category_t) OT_VPst; break;
}
}
}
static inline bool
-is_halant (const hb_glyph_info_t &info)
+is_halant_use (const hb_glyph_info_t &info)
{
return (info.use_category() == USE_H || info.use_category() == USE_HVM) &&
!_hb_glyph_info_ligated (&info);
for (unsigned int i = start + 1; i < end; i++)
{
bool is_post_base_glyph = (FLAG64_UNSAFE (info[i].use_category()) & POST_BASE_FLAGS64) ||
- is_halant (info[i]);
+ is_halant_use (info[i]);
if (is_post_base_glyph || i == end - 1)
{
/* If we hit a post-base glyph, move before it; otherwise move to the
for (unsigned int i = start; i < end; i++)
{
uint32_t flag = FLAG_UNSAFE (info[i].use_category());
- if (is_halant (info[i]))
+ if (is_halant_use (info[i]))
{
/* If we hit a halant, move after it; otherwise move to the beginning, and
* shift things in between forward. */
}
static inline void
-insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
- hb_font_t *font,
- hb_buffer_t *buffer)
+insert_dotted_circles_use (const hb_ot_shape_plan_t *plan HB_UNUSED,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
{
if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE))
return;
hb_font_t *font,
hb_buffer_t *buffer)
{
- insert_dotted_circles (plan, font, buffer);
+ insert_dotted_circles_use (plan, font, buffer);
foreach_syllable (buffer, start, end)
reorder_syllable_use (buffer, start, end);