Revert "Upstream merge"
[framework/uifw/evas.git] / src / lib / engines / common / evas_font_ot.c
index 9ed92c7..a907831 100644 (file)
@@ -243,7 +243,7 @@ _evas_common_font_ot_unicode_funcs_get(void)
 }
 
 static void
-_evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi, Evas_Text_Props_Mode mode)
+_evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi)
 {
    /* Create hb_font if not previously created */
    if (!fi->ft.hb_font)
@@ -258,20 +258,12 @@ _evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi, Evas_Text_Pro
               _evas_common_font_ot_font_funcs_get(), fi, NULL);
      }
 
-   if (mode == EVAS_TEXT_PROPS_MODE_SHAPE)
-     {
-        hb_shape(fi->ft.hb_font, buffer, NULL, 0);
-     }
-   else
-     {
-        const char *shaper_list[] = { "fallback", NULL };
-        hb_shape_full(fi->ft.hb_font, buffer, NULL, 0, shaper_list);
-     }
+   hb_shape(fi->ft.hb_font, buffer, NULL, 0);
 }
 
 EAPI Eina_Bool
 evas_common_font_ot_populate_text_props(const Eina_Unicode *text,
-      Evas_Text_Props *props, int len, Evas_Text_Props_Mode mode)
+      Evas_Text_Props *props, int len)
 {
    RGBA_Font_Int *fi;
    hb_buffer_t *buffer;
@@ -294,10 +286,19 @@ evas_common_font_ot_populate_text_props(const Eina_Unicode *text,
         slen = len;
      }
 
+#if HB_VERSION_CHECK(0,7,0)
+   buffer = hb_buffer_create(slen);
+#else
    buffer = hb_buffer_create();
+#endif
    hb_buffer_set_unicode_funcs(buffer, _evas_common_font_ot_unicode_funcs_get());
+#if HB_VERSION_CHECK(0,7,0)
+   hb_buffer_set_language(buffer, hb_language_from_string(
+            evas_common_language_from_locale_get()));
+#else
    hb_buffer_set_language(buffer, hb_language_from_string(
             evas_common_language_from_locale_get(), -1));
+#endif
    hb_buffer_set_script(buffer, _evas_script_to_harfbuzz[props->script]);
    hb_buffer_set_direction(buffer,
          (props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ?
@@ -305,7 +306,7 @@ evas_common_font_ot_populate_text_props(const Eina_Unicode *text,
    /* FIXME: add run-time conversions if needed, which is very unlikely */
    hb_buffer_add_utf32(buffer, (const uint32_t *) text, slen, 0, slen);
 
-   _evas_common_font_ot_shape(buffer, fi, mode);
+   _evas_common_font_ot_shape(buffer, fi);
 
    props->len = hb_buffer_get_length(buffer);
    props->info->ot = calloc(props->len,