diff --git a/legacy/evas/src/lib/engines/common/evas_font_ot.c b/legacy/evas/src/lib/engines/common/evas_font_ot.c index 9875629dd7..96cedbd1ae 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_ot.c +++ b/legacy/evas/src/lib/engines/common/evas_font_ot.c @@ -34,7 +34,7 @@ evas_common_font_ot_is_enabled(void) #ifdef OT_SUPPORT /* FIXME: doc. returns #items */ EAPI int -evas_common_font_ot_cluster_size_get(Evas_Text_Props *props, size_t char_index, int orig_len) +evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index, int orig_len) { int i; int items; @@ -61,24 +61,24 @@ evas_common_font_ot_cluster_size_get(Evas_Text_Props *props, size_t char_index, if (left_bound < 0) { items = orig_len - - props->ot_data->items[left_bound + 1].source_pos; + props->ot_data->items[left_bound + 1].source_cluster; } else { - items = props->ot_data->items[left_bound].source_pos - - props->ot_data->items[left_bound + 1].source_pos; + items = props->ot_data->items[left_bound].source_cluster - + props->ot_data->items[left_bound + 1].source_cluster; } } else { if (right_bound == (int) props->ot_data->len) { - items = orig_len - props->ot_data->items[left_bound].source_pos; + items = orig_len - props->ot_data->items[left_bound].source_cluster; } else { - items = props->ot_data->items[right_bound - 1].source_pos - - props->ot_data->items[right_bound].source_pos; + items = props->ot_data->items[right_bound - 1].source_cluster - + props->ot_data->items[right_bound].source_cluster; } } return (items > 0) ? items : 1; @@ -158,7 +158,7 @@ evas_common_font_ot_populate_text_props(void *_fn, const Eina_Unicode *text, for (i = 0 ; i < props->ot_data->len ; i++) { props->ot_data->items[i].index = infos[i].codepoint; - props->ot_data->items[i].source_pos = infos[i].cluster; + props->ot_data->items[i].source_cluster = infos[i].cluster; props->ot_data->items[i].x_advance = positions[i].x_advance; props->ot_data->items[i].x_offset = positions[i].x_offset; props->ot_data->items[i].y_offset = positions[i].y_offset; diff --git a/legacy/evas/src/lib/engines/common/evas_font_ot.h b/legacy/evas/src/lib/engines/common/evas_font_ot.h index b963ea0e6e..2b0be761c2 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_ot.h +++ b/legacy/evas/src/lib/engines/common/evas_font_ot.h @@ -28,7 +28,7 @@ struct _Evas_Font_OT_Data struct _Evas_Font_OT_Data_Item { unsigned int index; /* Should conform to FT */ - size_t source_pos; + size_t source_cluster; Evas_Coord x_offset; Evas_Coord y_offset; Evas_Coord x_advance; @@ -43,7 +43,7 @@ typedef void *Evas_Font_OT_Data; # define EVAS_FONT_OT_X_ADV_GET(a) ((a).x_advance) //# define EVAS_FONT_OT_Y_ADV_GET(a) ((a).y_advance) # define EVAS_FONT_OT_INDEX_GET(a) ((a).index) -# define EVAS_FONT_OT_POS_GET(a) ((a).source_pos) +# define EVAS_FONT_OT_POS_GET(a) ((a).source_cluster) #else # define EVAS_FONT_OT_X_OFF_GET(a) (0) # define EVAS_FONT_OT_Y_OFF_GET(a) (0) @@ -63,6 +63,9 @@ EAPI void evas_common_font_ot_props_unref(Evas_Font_OT_Data *data); #include "evas_text_utils.h" +EAPI int +evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index, int orig_len); + EAPI Eina_Bool evas_common_font_ot_populate_text_props(void *fn, const Eina_Unicode *text, Evas_Text_Props *props, int len);