const Evas_Object_Textblock_Text_Item *ti, size_t line_start,
const char *breaks)
{
+ int wrap;
size_t uwrap;
size_t len = eina_ustrbuf_length_get(ti->parent.text_node->unicode);
/* Currently not being used, because it doesn't contain relevant
(void) breaks;
{
- int wrap;
wrap = _layout_text_cutoff_get(c, fmt, ti);
if (wrap < 0)
return -1;
if (uwrap == line_start)
- MOVE_NEXT_UNTIL(len, uwrap);
+ {
+ uwrap = ti->parent.text_pos +
+ (size_t) evas_common_text_props_cluster_next(&ti->text_props, wrap);
+ }
if ((uwrap <= line_start) || (uwrap > len))
return -1;
}
}
+EAPI int
+evas_common_text_props_cluster_next(const Evas_Text_Props *props, int pos)
+{
+ int prop_pos = evas_common_text_props_index_find(props, pos);
+ if ((props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) && (prop_pos > 0))
+ {
+#ifdef OT_SUPPORT
+ return props->info->ot[props->start + prop_pos - 1].source_cluster -
+ props->text_offset;
+#else
+ return props->start + prop_pos - 1 - props->text_offset;
+#endif
+ }
+ else if ((props->bidi.dir != EVAS_BIDI_DIRECTION_RTL) &&
+ (prop_pos < (int) (props->len - 1)))
+ {
+#ifdef OT_SUPPORT
+ return props->info->ot[props->start + prop_pos + 1].source_cluster -
+ props->text_offset;
+#else
+ return props->start + prop_pos + 1 - props->text_offset;
+#endif
+ }
+
+ return pos;
+}
+
/* Returns the index of the logical char in the props. */
EAPI int
-evas_common_text_props_index_find(Evas_Text_Props *props, int _cutoff)
+evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff)
{
#ifdef OT_SUPPORT
Evas_Font_OT_Info *ot_info;
evas_common_text_props_content_unref(Evas_Text_Props *props);
EAPI int
-evas_common_text_props_index_find(Evas_Text_Props *props, int _cutoff);
+evas_common_text_props_cluster_next(const Evas_Text_Props *props, int pos);
+
+EAPI int
+evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff);
EAPI void
evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,