forked from enlightenment/efl
Evas font-ot: renamed internal source_pos to source_cluster and added the forgotten evas_common_font_ot_cluster_size_get to the .h file.
SVN revision: 56463
This commit is contained in:
parent
c09000741b
commit
63e25655e1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue