* Fix evas_free callback deletion to not sometimes abort evas freeing
in some situations, thus leaking.
+2012-06-10 Carsten Haitzler (The Rasterman)
+
+ * Fix evas font handling so bitmap fonts work again like they
+ once did. This ifxes max height, and max ascent/descent
+ calculation for 0 em fonts with 0 bbox size (bitmap case), and
+ fixes 1 rounding error in text objects that placed ascent in the wrong
+ place by 1 pixel for even ascents.
+
obj->cur.geometry.x + x + sl + ox + it->x, \
obj->cur.geometry.y + y + st + oy + \
(int) \
- (((o->max_ascent * obj->cur.geometry.h) / obj->cur.geometry.h) - 0.5), \
+ (((o->max_ascent * obj->cur.geometry.h) / obj->cur.geometry.h)), \
obj->cur.geometry.w, \
obj->cur.geometry.h, \
obj->cur.geometry.w, \
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);
}
- else ret = val;
+ else
+ {
+ if ((fi->src->ft.face->bbox.yMax == 0) &&
+ (fi->src->ft.face->bbox.yMin == 0))
+ ret = (int)fi->ft.size->metrics.ascender / 64;
+ else
+ ret = val;
+ }
fi->max_h += ret;
val = -(int)fi->src->ft.face->bbox.yMin;
if (fi->src->ft.face->units_per_EM != 0)
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);
}
- else ret = val;
+ else
+ {
+ if ((fi->src->ft.face->bbox.yMax == 0) &&
+ (fi->src->ft.face->bbox.yMin == 0))
+ ret = -(int)fi->ft.size->metrics.descender / 64;
+ else
+ ret = val;
+ }
fi->max_h += ret;
/* If the loaded font doesn't match with wanted_rend value requested by
FTUNLOCK();
fi->src->current_size = fi->size;
}
- val = (int)fi->src->ft.face->bbox.yMax;
+ if ((fi->src->ft.face->bbox.yMax == 0) &&
+ (fi->src->ft.face->bbox.yMin == 0) &&
+ (fi->src->ft.face->units_per_EM == 0))
+ val = (int)fi->src->ft.face->size->metrics.ascender / 64;
+ else
+ val = (int)fi->src->ft.face->bbox.yMax;
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;
FTUNLOCK();
fi->src->current_size = fi->size;
}
- val = -(int)fi->src->ft.face->bbox.yMin;
+ if ((fi->src->ft.face->bbox.yMax == 0) &&
+ (fi->src->ft.face->bbox.yMin == 0) &&
+ (fi->src->ft.face->units_per_EM == 0))
+ val = -(int)fi->src->ft.face->size->metrics.descender / 64;
+ else
+ val = -(int)fi->src->ft.face->bbox.yMin;
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;