Imported Upstream version 2.6.7
[platform/upstream/harfbuzz.git] / src / hb-ot-shape-complex-vowel-constraints.cc
index 0e53258..c3368c6 100644 (file)
@@ -2,17 +2,22 @@
 /*
  * The following functions are generated by running:
  *
- *   ./gen-vowel-constraints.py use Scripts.txt
+ *   ./gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt Scripts.txt
  *
  * on files with these headers:
  *
- * # Copied from https://docs.microsoft.com/en-us/typography/script-development/use
- * # On October 23, 2018; with documentd dated 02/07/2018.
+ * # IndicShapingInvalidCluster.txt
+ * # Date: 2015-03-12, 21:17:00 GMT [AG]
+ * # Date: 2019-11-08, 23:22:00 GMT [AG]
  *
- * # Scripts-11.0.0.txt
- * # Date: 2018-02-21, 05:34:31 GMT
+ * # Scripts-13.0.0.txt
+ * # Date: 2020-01-22, 00:07:43 GMT
  */
 
+#include "hb.hh"
+
+#ifndef HB_NO_OT_SHAPE
+
 #include "hb-ot-shape-complex-vowel-constraints.hh"
 
 static void
@@ -34,6 +39,12 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
                                       hb_buffer_t              *buffer,
                                       hb_font_t                *font HB_UNUSED)
 {
+#ifdef HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS
+  return;
+#endif
+  if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)
+    return;
+
   /* UGLY UGLY UGLY business of adding dotted-circle in the middle of
    * vowel-sequences that look like another vowel.  Data for each script
    * collected from the USE script development spec.
@@ -87,8 +98,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
                0x0907u == buffer->cur (2).codepoint)
            {
              buffer->next_glyph ();
-             buffer->next_glyph ();
-             _output_dotted_circle (buffer);
+             matched = true;
            }
            break;
        }
@@ -201,6 +211,21 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
       processed = true;
       break;
 
+    case HB_SCRIPT_TAMIL:
+      for (buffer->idx = 0; buffer->idx + 1 < count && buffer->successful;)
+      {
+       bool matched = false;
+       if (0x0B85u == buffer->cur ().codepoint &&
+           0x0BC2u == buffer->cur (1).codepoint)
+       {
+         matched = true;
+       }
+       buffer->next_glyph ();
+       if (matched) _output_with_dotted_circle (buffer);
+      }
+      processed = true;
+      break;
+
     case HB_SCRIPT_TELUGU:
       for (buffer->idx = 0; buffer->idx + 1 < count && buffer->successful;)
       {
@@ -434,4 +459,6 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
   }
 }
 
+
+#endif
 /* == End of generated functions == */