raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0987f06e6b3bf3d7994f326838dcf3d28aa06830

commit 0987f06e6b3bf3d7994f326838dcf3d28aa06830
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Aug 17 22:22:44 2014 +0900

    evas text - fix text object expanding when it gets some unicode in it
    
    the text object walked all text items and took the biggest. when that
    big item used some fallback font that didnt match the primary font in
    ascent/descent etc. things went wrong - text expanded when not
    expected to. this makes text objects just use the primary font
    ascent/descent metrics and fixes e titlebar magically expanding thus
    compressing window content when not expected.
---
 src/lib/evas/canvas/evas_object_text.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_text.c 
b/src/lib/evas/canvas/evas_object_text.c
index a56aa50..488171c 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -2236,6 +2236,7 @@ _evas_object_text_recalc(Evas_Object *eo_obj, 
Eina_Unicode *text)
    /* Calc ascent/descent. */
    if (o->items)
      {
+/*
         Evas_Object_Text_Item *item;
 
         for (item = o->items ; item ;
@@ -2244,7 +2245,7 @@ _evas_object_text_recalc(Evas_Object *eo_obj, 
Eina_Unicode *text)
           {
              int asc = 0, desc = 0;
 
-             /* Skip items without meaning full information. */
+             // Skip items without meaning full information.
              if (!item->text_props.font_instance) continue;
 
              asc = 
evas_common_font_instance_ascent_get(item->text_props.font_instance);
@@ -2257,6 +2258,14 @@ _evas_object_text_recalc(Evas_Object *eo_obj, 
Eina_Unicode *text)
              if (asc > o->max_ascent) o->max_ascent = asc;
              if (desc > o->max_descent) o->max_descent = desc;
           }
+ */
+        if (o->font)
+          {
+             o->ascent = ENFN->font_ascent_get(ENDT, o->font);
+             o->descent = ENFN->font_descent_get(ENDT, o->font);
+             o->max_ascent = ENFN->font_max_ascent_get(ENDT, o->font);
+             o->max_descent = ENFN->font_max_descent_get(ENDT, o->font);
+          }
      }
    else if (o->font)
      {

-- 


Reply via email to