#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;
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;
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;
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;
# 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)
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);