summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-23 22:25:19 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-23 22:25:19 +0900
commit2bb9d9563c484fdc0a7c82b43cbdf9f52fd1646f (patch)
tree4ce73f8484e7762376adbd6b8e62f20be7cb7c7e /src
parent8ca7a21403f93f69bfc921f85b8df95ab6edbe43 (diff)
textgrid - with new fallback fonts we cant depend on glyph extents anymore
now that glyphs can exceed the bounds of the original query for the font, there is no pointusing max ascent/descent bounds. back to plain ascent and decent then so you may get fewer gaps in some fonts. this fixes font gaps consiering trying to wrk otherwise now is pointless.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index 0020ed0528..6bfb5a14b1 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -58,7 +58,7 @@ struct _Evas_Object_Textgrid
58 Eina_Array palette_extended; 58 Eina_Array palette_extended;
59 } cur, prev; 59 } cur, prev;
60 60
61 int max_ascent; 61 int ascent;
62 62
63 Evas_Font_Set *font; 63 Evas_Font_Set *font;
64 64
@@ -669,11 +669,11 @@ evas_object_textgrid_render(Evas_Object *eo_obj,
669 // merged into horizontal runs like bg rects above 669 // merged into horizontal runs like bg rects above
670 if (cells->underline) 670 if (cells->underline)
671 evas_object_textgrid_row_line_append(row, xp, w, 671 evas_object_textgrid_row_line_append(row, xp, w,
672 o->max_ascent + 1, 672 o->ascent + 1,
673 c->r, c->g, c->b, c->a); 673 c->r, c->g, c->b, c->a);
674 if (cells->strikethrough) 674 if (cells->strikethrough)
675 evas_object_textgrid_row_line_append(row, xp, w, 675 evas_object_textgrid_row_line_append(row, xp, w,
676 ((3 * o->max_ascent) / 4), 676 ((3 * o->ascent) / 4),
677 c->r, c->g, c->b, c->a); 677 c->r, c->g, c->b, c->a);
678 } 678 }
679 } 679 }
@@ -750,7 +750,7 @@ evas_object_textgrid_render(Evas_Object *eo_obj,
750 750
751 async_unref = 751 async_unref =
752 ENFN->multi_font_draw(output, context, surface, 752 ENFN->multi_font_draw(output, context, surface,
753 o->font, xp, yp + o->max_ascent, 753 o->font, xp, yp + o->ascent,
754 ww, hh, ww, hh, texts, do_async); 754 ww, hh, ww, hh, texts, do_async);
755 if (async_unref) 755 if (async_unref)
756 evas_unref_queue_texts_put(obj->layer->evas, texts); 756 evas_unref_queue_texts_put(obj->layer->evas, texts);
@@ -769,7 +769,7 @@ evas_object_textgrid_render(Evas_Object *eo_obj,
769 Evas_Text_Props *props; 769 Evas_Text_Props *props;
770 unsigned int r, g, b, a; 770 unsigned int r, g, b, a;
771 int tx = xp + row->texts[xx].x; 771 int tx = xp + row->texts[xx].x;
772 int ty = yp + o->max_ascent; 772 int ty = yp + o->ascent;
773 773
774 props = 774 props =
775 evas_object_textgrid_textprop_int_to 775 evas_object_textgrid_textprop_int_to
@@ -1273,7 +1273,7 @@ _font_set(Eo *eo_obj, void *_pd, va_list *list)
1273 obj->cur->scale)); 1273 obj->cur->scale));
1274 if (o->font) 1274 if (o->font)
1275 { 1275 {
1276 Eina_Unicode W[2] = { 'W', 0 }; 1276 Eina_Unicode W[2] = { 'O', 0 };
1277 Evas_Font_Instance *script_fi = NULL; 1277 Evas_Font_Instance *script_fi = NULL;
1278 Evas_Font_Instance *cur_fi = NULL; 1278 Evas_Font_Instance *cur_fi = NULL;
1279 Evas_Text_Props text_props; 1279 Evas_Text_Props text_props;
@@ -1288,14 +1288,11 @@ _font_set(Eo *eo_obj, void *_pd, va_list *list)
1288 ENFN->font_text_props_info_create(ENDT, script_fi, W, &text_props, 1288 ENFN->font_text_props_info_create(ENDT, script_fi, W, &text_props,
1289 NULL, 0, 1, 1289 NULL, 0, 1,
1290 EVAS_TEXT_PROPS_MODE_NONE); 1290 EVAS_TEXT_PROPS_MODE_NONE);
1291 ENFN->font_string_size_get(ENDT, o->font, &text_props,
1292 &o->cur.char_width, &o->cur.char_height);
1293 o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->font);
1294// inset = ENFN->font_inset_get(ENDT, o->font, &text_props);
1295 advance = ENFN->font_h_advance_get(ENDT, o->font, &text_props); 1291 advance = ENFN->font_h_advance_get(ENDT, o->font, &text_props);
1296 vadvance = ENFN->font_v_advance_get(ENDT, o->font, &text_props); 1292 vadvance = ENFN->font_v_advance_get(ENDT, o->font, &text_props);
1297 if (advance > o->cur.char_width) o->cur.char_width = advance; 1293 o->cur.char_width = advance;
1298 if (vadvance > o->cur.char_height) o->cur.char_height = vadvance; 1294 o->cur.char_height = vadvance;
1295 o->ascent = ENFN->font_ascent_get(ENDT, o->font);;
1299 evas_common_text_props_content_unref(&text_props); 1296 evas_common_text_props_content_unref(&text_props);
1300 } 1297 }
1301 else 1298 else
@@ -1307,7 +1304,7 @@ _font_set(Eo *eo_obj, void *_pd, va_list *list)
1307 } 1304 }
1308 EINA_COW_STATE_WRITE_END(obj, state_write, cur); 1305 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
1309 1306
1310 o->max_ascent = 0; 1307 o->ascent = 0;
1311 } 1308 }
1312 1309
1313 o->changed = 1; 1310 o->changed = 1;