Evas font: Fixed a bug with cluster sizes and ligatures.

This casused cursor position (among other things) to look wrong with texts
ending with ligatures.

Thanks to Yakov Goldberg for reporting.
This commit is contained in:
Tom Hacohen 2013-04-08 13:30:31 +01:00
parent 2364f4514b
commit 920c1b2af8
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-04-08 Tom Hacohen
* Evas font: Fix a bug with cluster size calculation with texts ending
with ligatures.
2013-04-08 Carsten Haitzler (The Rasterman)
* Evas: Add control API for multiple outputs (non-functional).

2
NEWS
View File

@ -225,3 +225,5 @@ Fixes:
* Evas font: If OS/2 table is available and the font is demi-bold, don't do runtime emboldment.
* Evas font: fix font source have wrong current size.
* Evas: Fix over redrawing of Evas_Map when applied on smart object.
* Evas font: Fix a bug with cluster size calculation with texts ending
with ligatures.

View File

@ -166,7 +166,7 @@ evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_i
}
else
{
if (right_bound >= (int) (props->text_offset + props->text_len))
if (right_bound >= (int) (props->start + props->len))
{
items = props->text_offset + props->text_len - base_cluster;
}

View File

@ -604,6 +604,27 @@ START_TEST(evas_textblock_cursor)
fail_if(1 != evas_textblock_cursor_pos_get(cur));
}
/* Make sure coords are correct for ligatures */
{
evas_object_textblock_text_markup_set(tb, "fi<br/>fii");
for (i = 0 ; i < 2 ; i++)
{
evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
ck_assert_int_eq(w, 3);
evas_textblock_cursor_char_next(cur);
}
evas_textblock_cursor_char_next(cur);
for (i = 0 ; i < 3 ; i++)
{
evas_textblock_cursor_pen_geometry_get(cur, NULL, NULL, &w, NULL);
ck_assert_int_eq(w, 3);
evas_textblock_cursor_char_next(cur);
}
}
END_TB_TEST();
}
END_TEST