Merge remote branch 'martin/master'
[framework/uifw/harfbuzz.git] / src / hb-ot-shape.cc
index ac453f4..727772a 100644 (file)
 
 #include "hb-ot-layout.h"
 
+/* XXX vertical */
 hb_tag_t default_features[] = {
-  /* GSUB */
+  HB_TAG('c','a','l','t'),
   HB_TAG('c','c','m','p'),
-  HB_TAG('l','o','c','l'),
-  HB_TAG('l','i','g','a'),
   HB_TAG('c','l','i','g'),
-  /* GPOS */
+  HB_TAG('c','s','w','h'),
+  HB_TAG('c','u','r','s'),
   HB_TAG('k','e','r','n'),
+  HB_TAG('l','i','g','a'),
+  HB_TAG('l','o','c','l'),
   HB_TAG('m','a','r','k'),
   HB_TAG('m','k','m','k'),
+  HB_TAG('r','l','i','g')
 };
 
 enum {
@@ -280,7 +283,7 @@ hb_form_clusters (hb_buffer_t *buffer)
 {
   unsigned int count = buffer->len;
   for (unsigned int i = 1; i < count; i++)
-    if (buffer->unicode->get_general_category (buffer->info[i].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
+    if (buffer->unicode->v.get_general_category (buffer->info[i].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
       buffer->info[i].cluster = buffer->info[i - 1].cluster;
 }
 
@@ -306,7 +309,7 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
 static void
 hb_mirror_chars (hb_buffer_t *buffer)
 {
-  hb_unicode_get_mirroring_func_t get_mirroring = buffer->unicode->get_mirroring;
+  hb_unicode_get_mirroring_func_t get_mirroring = buffer->unicode->v.get_mirroring;
 
   if (HB_DIRECTION_IS_FORWARD (buffer->direction))
     return;
@@ -348,7 +351,6 @@ hb_substitute_default (hb_font_t    *font,
                       hb_feature_t *features HB_UNUSED,
                       unsigned int  num_features HB_UNUSED)
 {
-  hb_mirror_chars (buffer);
   hb_map_glyphs (font, face, buffer);
 }
 
@@ -442,12 +444,13 @@ hb_ot_shape (hb_font_t    *font,
 
   buffer->clear_masks ();
 
-  hb_substitute_default (font, face, buffer, features, num_features);
+  /* Mirroring needs to see the original direction */
+  hb_mirror_chars (buffer);
 
-  /* We do this after substitute_default because mirroring needs to
-   * see the original direction. */
   original_direction = hb_ensure_native_direction (buffer);
 
+  hb_substitute_default (font, face, buffer, features, num_features);
+
   substitute_fallback = !hb_ot_substitute_complex (font, face, buffer, features, num_features, original_direction);
 
   if (substitute_fallback)