diff --git a/ChangeLog b/ChangeLog index 1206dcc659..6289b14ddd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-10-02 Tom Hacohen + + * Evas textblock: Use correct font underline properties when drawing + underlines. + 2013-10-01 Vincent Torri * Evas: add JPEG 2000 support. diff --git a/NEWS b/NEWS index b486810930..93e9e9a827 100644 --- a/NEWS +++ b/NEWS @@ -69,6 +69,7 @@ Additions: - Evas font: Use our own fontconfig configuration so we don't get affected by changes made to the default fontconfig configuration. - Evas font: Make the evas_font_path_* functions apply to fontconfig searches. - Add JPEG 2000 loader. + - Evas textblock: Use correct font underline properties when drawing underlines. * Ecore_X: - Add window profile support. ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ce34a1cdfe..021f59aaee 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3460,6 +3460,8 @@ loop_advance: } c->ln->baseline = c->ascent; + /* FIXME: Actually needs to be adjusted using the actual font value. + * Also, underline_extend is actually not being used. */ if (c->have_underline2) { if (c->descent < 4) c->underline_extend = 4 - c->descent; @@ -11087,6 +11089,11 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, ITEM_WALK_END(); /* normal text and lines */ + /* Get the thickness and position, and save them for non-text items. */ + int line_thickness = + evas_common_font_instance_underline_thickness_get(NULL); + int line_position = + evas_common_font_instance_underline_position_get(NULL); ITEM_WALK() { Evas_Object_Textblock_Text_Item *ti; @@ -11094,23 +11101,30 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, /* NORMAL TEXT */ if (ti) { + void *fi = _ITEM_TEXT(itr)->text_props.font_instance; COLOR_SET(normal); DRAW_TEXT(0, 0); + line_thickness = + evas_common_font_instance_underline_thickness_get(fi); + line_position = + evas_common_font_instance_underline_position_get(fi); } /* STRIKETHROUGH */ - DRAW_FORMAT(strikethrough, (ln->h / 2), 1); + DRAW_FORMAT(strikethrough, (ln->h / 2), line_thickness); /* UNDERLINE */ - DRAW_FORMAT(underline, ln->baseline + 1, 1); + DRAW_FORMAT(underline, ln->baseline + line_position, line_thickness); /* UNDERLINE DASHED */ - DRAW_FORMAT_DASHED(underline_dash, ln->baseline + 1, 1, + DRAW_FORMAT_DASHED(underline_dash, ln->baseline + line_position, + line_thickness, ti->parent.format->underline_dash_width, ti->parent.format->underline_dash_gap); /* UNDERLINE2 */ - DRAW_FORMAT(underline2, ln->baseline + 3, 1); + DRAW_FORMAT(underline2, ln->baseline + line_position + line_thickness + + line_position, line_thickness); } ITEM_WALK_END(); }