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)
|
if (fmt->font.font)
|
||||||
{
|
{
|
||||||
// ascent = c->ENFN->font_ascent_get(c->ENDT, fmt->font.font);
|
// ascent = c->ENFN->font_max_ascent_get(c->ENDT, fmt->font.font);
|
||||||
// descent = c->ENFN->font_descent_get(c->ENDT, fmt->font.font);
|
// descent = c->ENFN->font_max_descent_get(c->ENDT, fmt->font.font);
|
||||||
// printf("asc: %4i desc: %4i\n", ascent, descent);
|
ascent = c->ENFN->font_ascent_get(c->ENDT, fmt->font.font);
|
||||||
ascent = c->ENFN->font_max_ascent_get(c->ENDT, fmt->font.font);
|
descent = c->ENFN->font_descent_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);
|
|
||||||
if (fmt->linesize > 0)
|
if (fmt->linesize > 0)
|
||||||
{
|
{
|
||||||
if ((ascent + descent) < fmt->linesize)
|
if ((ascent + descent) < fmt->linesize)
|
||||||
|
|
|
@ -73,19 +73,25 @@ evas_common_font_ascent_get(RGBA_Font *fn)
|
||||||
printf(" ==== %p: %i\n", fi, ret);
|
printf(" ==== %p: %i\n", fi, ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fi = fn->fonts->data;
|
fi = fn->fonts->data;
|
||||||
if (fi->src->current_size != fi->size)
|
if (fi->src->current_size != fi->size)
|
||||||
{
|
{
|
||||||
FT_Activate_Size(fi->ft.size);
|
FT_Activate_Size(fi->ft.size);
|
||||||
fi->src->current_size = fi->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;
|
val = (int)fi->src->ft.face->size->metrics.ascender;
|
||||||
if (fi->src->ft.face->units_per_EM == 0)
|
return val >> 6;
|
||||||
return val;
|
// printf("%i | %i\n", val, val >> 6);
|
||||||
dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
|
// if (fi->src->ft.face->units_per_EM == 0)
|
||||||
ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
|
// return val;
|
||||||
return ret;
|
// 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
|
EAPI int
|
||||||
|
@ -103,11 +109,12 @@ evas_common_font_descent_get(RGBA_Font *fn)
|
||||||
fi->src->current_size = fi->size;
|
fi->src->current_size = fi->size;
|
||||||
}
|
}
|
||||||
val = -(int)fi->src->ft.face->size->metrics.descender;
|
val = -(int)fi->src->ft.face->size->metrics.descender;
|
||||||
if (fi->src->ft.face->units_per_EM == 0)
|
return val >> 6;
|
||||||
return val;
|
// if (fi->src->ft.face->units_per_EM == 0)
|
||||||
dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
|
// return val;
|
||||||
ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
|
// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
|
||||||
return ret;
|
// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
|
||||||
|
// return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
|
@ -171,9 +178,10 @@ evas_common_font_get_line_advance(RGBA_Font *fn)
|
||||||
val = (int)fi->src->ft.face->size->metrics.height;
|
val = (int)fi->src->ft.face->size->metrics.height;
|
||||||
if (fi->src->ft.face->units_per_EM == 0)
|
if (fi->src->ft.face->units_per_EM == 0)
|
||||||
return val;
|
return val;
|
||||||
dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
|
return val >> 6;
|
||||||
ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
|
// dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;
|
||||||
return ret;
|
// ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
|
||||||
|
// return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
|
|
Loading…
Reference in New Issue