Enlightenment CVS committal Author : raster Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/lib Modified Files: edje_calc.c Log Message: fix up edje to calc using the same font as the textclass. =================================================================== RCS file: /cvs/e/e17/libs/edje/src/lib/edje_calc.c,v retrieving revision 1.109 retrieving revision 1.110 diff -u -3 -r1.109 -r1.110 --- edje_calc.c 12 Sep 2007 15:12:07 -0000 1.109 +++ edje_calc.c 17 Sep 2007 11:33:16 -0000 1.110 @@ -600,6 +600,7 @@ { const char *text; const char *font; + char *sfont = NULL; int size; Evas_Coord tw, th; int inlined_font = 0; @@ -640,7 +641,35 @@ tc = _edje_text_class_find(ed, ep->text.source->chosen_description->text.text_class); if (tc) { - if (tc->font) font = tc->font; + if ((tc->font) && (chosen_desc->text.font)) + { + char *tok, *tok2, *e; + + tok = strstr(chosen_desc->text.font, ":style="); + tok2 = strstr(tc->font, ":style="); + if ((tok) && (!tok2)) + { + char *stl; + int tclen; + + e = strchr(tok, ','); + stl = alloca(e - tok + 1); + strncpy(stl, tok, e - tok); + stl[e - tok] = 0; + font = tc->font; + tclen = strlen(tc->font); + sfont = malloc(tclen + e - tok + 1); + strcpy(sfont, tc->font); + strcpy(sfont + tclen, stl); + font = sfont; + } + else + font = tc->font; + } + else + { + if (tc->font) font = tc->font; + } size = _edje_text_size_calc(size, tc); } } @@ -654,7 +683,35 @@ tc = _edje_text_class_find(ed, chosen_desc->text.text_class); if (tc) { - if (tc->font) font = tc->font; + if ((tc->font) && (chosen_desc->text.font)) + { + char *tok, *tok2, *e; + + tok = strstr(chosen_desc->text.font, ":style="); + tok2 = strstr(tc->font, ":style="); + if ((tok) && (!tok2)) + { + char *stl; + int tclen; + + e = strchr(tok, ','); + stl = alloca(e - tok + 1); + strncpy(stl, tok, e - tok); + stl[e - tok] = 0; + font = tc->font; + tclen = strlen(tc->font); + sfont = malloc(tclen + e - tok + 1); + strcpy(sfont, tc->font); + strcpy(sfont + tclen, stl); + font = sfont; + } + else + font = tc->font; + } + else + { + if (tc->font) font = tc->font; + } size = _edje_text_size_calc(size, tc); } } @@ -769,6 +826,7 @@ if (mh > minh) minh = mh; } } + if (sfont) free(sfont); } /* rememebr what our size is BEFORE we go limit it */ params->req.x = params->x; ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs