[Indic] Apply 'init' feature for Bengali
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 11 May 2012 18:59:26 +0000 (20:59 +0200)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 11 May 2012 18:59:26 +0000 (20:59 +0200)
Error down from 20% to 7%.

src/hb-ot-shape-complex-indic.cc

index 7e3851d..20e7ed7 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "hb-ot-shape-complex-indic-private.hh"
+#include "hb-ot-shape-private.hh"
 
 static const struct indic_options_t
 {
@@ -738,6 +739,20 @@ final_reordering_syllable (hb_buffer_t *buffer, hb_mask_t *mask_array,
 
 
 
+  /* Apply 'init' to the Left Matra if it's a word start. */
+  if (info[start].indic_position () == POS_LEFT_MATRA &&
+      (!start ||
+       !(FLAG (_hb_glyph_info_get_general_category (&buffer->info[start - 1])) &
+        (FLAG (HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
+         FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))))
+    info[start].mask |= mask_array[INIT];
+
 
 
   /* Finish off the clusters and go home! */