From be8b9f5f715f6fb36b98bd33c3303f79cc068f8a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Jul 2012 12:11:12 -0400 Subject: [PATCH] [Indic] Start refactoring different matra positions per script --- src/hb-ot-shape-complex-indic-private.hh | 36 +++++++++++++++--------- src/hb-ot-shape-complex-indic.cc | 4 +-- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh index ac117326..acbbe463 100644 --- a/src/hb-ot-shape-complex-indic-private.hh +++ b/src/hb-ot-shape-complex-indic-private.hh @@ -69,15 +69,23 @@ enum indic_position_t { POS_RA_TO_BECOME_REPH, POS_PRE_M, POS_PRE_C, + POS_BASE_C, + POS_AFTER_MAIN, + POS_ABOVE_C, + + POS_BEFORE_SUB, POS_BELOW_C, - POS_ABOVE_M, - POS_BELOW_M, + POS_AFTER_SUB, + + POS_BEFORE_POST, POS_POST_C, - POS_POST_M, + POS_AFTER_POST, + POS_FINAL_C, - POS_SMVD + POS_SMVD, + POS_END }; /* Categories used in IndicSyllabicCategory.txt from UCD. */ @@ -111,9 +119,9 @@ enum indic_matra_category_t { INDIC_MATRA_CATEGORY_NOT_APPLICABLE = POS_BASE_C, INDIC_MATRA_CATEGORY_LEFT = POS_PRE_M, - INDIC_MATRA_CATEGORY_TOP = POS_ABOVE_M, - INDIC_MATRA_CATEGORY_BOTTOM = POS_BELOW_M, - INDIC_MATRA_CATEGORY_RIGHT = POS_POST_M, + INDIC_MATRA_CATEGORY_TOP = POS_BEFORE_POST, + INDIC_MATRA_CATEGORY_BOTTOM = POS_BEFORE_POST, + INDIC_MATRA_CATEGORY_RIGHT = POS_AFTER_POST, /* We don't really care much about these since we decompose them * in the generic pre-shaping layer. They will only be used if @@ -124,13 +132,13 @@ enum indic_matra_category_t { * TODO: There are some split matras without Unicode decompositions. * We have to figure out what to do with them. */ - INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT = POS_POST_M, - INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT = POS_POST_M, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM = POS_BELOW_M, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT = POS_POST_M, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT = POS_ABOVE_M, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT = POS_POST_M, - INDIC_MATRA_CATEGORY_TOP_AND_RIGHT = POS_POST_M, + INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT = POS_AFTER_POST, + INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT = POS_AFTER_POST, + INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM = POS_BEFORE_POST, + INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT = POS_AFTER_POST, + INDIC_MATRA_CATEGORY_TOP_AND_LEFT = POS_BEFORE_POST, + INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT = POS_AFTER_POST, + INDIC_MATRA_CATEGORY_TOP_AND_RIGHT = POS_AFTER_POST, INDIC_MATRA_CATEGORY_INVISIBLE = INDIC_MATRA_CATEGORY_NOT_APPLICABLE, INDIC_MATRA_CATEGORY_OVERSTRUCK = INDIC_MATRA_CATEGORY_NOT_APPLICABLE, diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 2aaac547..bb56c425 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -846,7 +846,7 @@ final_reordering_syllable (hb_buffer_t *buffer, new_reph_pos = base; /* XXX Skip potential pre-base reordering Ra. */ while (new_reph_pos < end && - !( FLAG (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_BELOW_C) | FLAG (POS_POST_C) | FLAG (POS_POST_M) | FLAG (POS_SMVD)))) + !( FLAG (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_BELOW_C) | FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD)))) new_reph_pos++; if (new_reph_pos < end) goto reph_move; @@ -862,7 +862,7 @@ final_reordering_syllable (hb_buffer_t *buffer, { new_reph_pos = base; while (new_reph_pos < end && - !( FLAG (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_POST_M) | FLAG (POS_SMVD)))) + !( FLAG (info[new_reph_pos + 1].indic_position()) & (FLAG (POS_POST_C) | FLAG (POS_AFTER_POST) | FLAG (POS_SMVD)))) new_reph_pos++; if (new_reph_pos < end) goto reph_move; -- GitLab