From: raster Date: Wed, 20 Jun 2012 04:45:05 +0000 (+0000) Subject: fix grid sizing for textgrid with some mono ttf fonts! X-Git-Tag: submit/trunk/20120815.174732~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92b32852895b25b38799647dd286c49fe6138f3b;p=profile%2Fivi%2Fevas.git fix grid sizing for textgrid with some mono ttf fonts! git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@72511 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textgrid.c b/src/lib/canvas/evas_object_textgrid.c index 25dc517..b2ac637 100644 --- a/src/lib/canvas/evas_object_textgrid.c +++ b/src/lib/canvas/evas_object_textgrid.c @@ -1124,6 +1124,7 @@ evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font Evas_Font_Instance *cur_fi = NULL; Evas_Text_Props text_props; Evas_Script_Type script; + int advance, vadvance; script = evas_common_language_script_type_get(W, 1); ENFN->font_run_end_get(ENDT, o->font, &script_fi, &cur_fi, @@ -1136,6 +1137,10 @@ evas_object_textgrid_font_set(Evas_Object *obj, const char *font_name, Evas_Font ENFN->font_string_size_get(ENDT, o->font, &text_props, &o->cur.char_width, &o->cur.char_height); o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->font); + advance = ENFN->font_h_advance_get(ENDT, o->font, &text_props); + vadvance = ENFN->font_v_advance_get(ENDT, o->font, &text_props); + if (advance > o->cur.char_width) o->cur.char_width = advance; + if (vadvance > o->cur.char_height) o->cur.char_height = vadvance; evas_common_text_props_content_unref(&text_props); } else