From: raster Date: Sat, 1 May 2010 14:08:14 +0000 (+0000) Subject: hmm - i don't know how this happened, but - metrics were not being done X-Git-Tag: accepted/2.0/20130306.225542~242^2~1874 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebfd201bae7c131a3301fa8f06e8c9bf2467c3aa;p=profile%2Fivi%2Fevas.git hmm - i don't know how this happened, but - metrics were not being done right. fixed now. i wonder why. this used to be right at some point. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@48503 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index 6253e89..ddb7fc3 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -1334,12 +1334,10 @@ _layout_format_ascent_descent_adjust(Ctxt *c, Evas_Object_Textblock_Format *fmt) if (fmt->font.font) { -// ascent = c->ENFN->font_ascent_get(c->ENDT, fmt->font.font); -// descent = c->ENFN->font_descent_get(c->ENDT, fmt->font.font); -// printf("asc: %4i desc: %4i\n", ascent, descent); - ascent = c->ENFN->font_max_ascent_get(c->ENDT, fmt->font.font); - descent = c->ENFN->font_max_descent_get(c->ENDT, fmt->font.font); -// printf(" max asc: %4i desc: %4i\n", ascent, descent); +// ascent = c->ENFN->font_max_ascent_get(c->ENDT, fmt->font.font); +// descent = c->ENFN->font_max_descent_get(c->ENDT, fmt->font.font); + ascent = c->ENFN->font_ascent_get(c->ENDT, fmt->font.font); + descent = c->ENFN->font_descent_get(c->ENDT, fmt->font.font); if (fmt->linesize > 0) { if ((ascent + descent) < fmt->linesize) diff --git a/src/lib/engines/common/evas_font_main.c b/src/lib/engines/common/evas_font_main.c index f67b777..45be497 100644 --- a/src/lib/engines/common/evas_font_main.c +++ b/src/lib/engines/common/evas_font_main.c @@ -73,19 +73,25 @@ evas_common_font_ascent_get(RGBA_Font *fn) printf(" ==== %p: %i\n", fi, ret); } } -#endif +#endif fi = fn->fonts->data; if (fi->src->current_size != fi->size) { FT_Activate_Size(fi->ft.size); fi->src->current_size = fi->size; } + if (!FT_IS_SCALABLE(fi->src->ft.face)) + { + printf("NOT SCALABLE!\n"); + } val = (int)fi->src->ft.face->size->metrics.ascender; - if (fi->src->ft.face->units_per_EM == 0) - return val; - dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; - ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); - return ret; + return val >> 6; +// printf("%i | %i\n", val, val >> 6); +// if (fi->src->ft.face->units_per_EM == 0) +// return val; +// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; +// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); +// return ret; } EAPI int @@ -103,11 +109,12 @@ evas_common_font_descent_get(RGBA_Font *fn) fi->src->current_size = fi->size; } val = -(int)fi->src->ft.face->size->metrics.descender; - if (fi->src->ft.face->units_per_EM == 0) - return val; - dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; - ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); - return ret; + return val >> 6; +// if (fi->src->ft.face->units_per_EM == 0) +// return val; +// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; +// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); +// return ret; } EAPI int @@ -171,9 +178,10 @@ evas_common_font_get_line_advance(RGBA_Font *fn) val = (int)fi->src->ft.face->size->metrics.height; if (fi->src->ft.face->units_per_EM == 0) return val; - dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; - ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); - return ret; + return val >> 6; +// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; +// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv); +// return ret; } EAPI int