forked from enlightenment/efl
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. SVN revision: 48503
This commit is contained in:
parent
c10f1e9c5d
commit
15b7e11198
|
@ -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)
|
||||
|
|
|
@ -80,12 +80,18 @@ evas_common_font_ascent_get(RGBA_Font *fn)
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue