diff --git a/legacy/evas/src/lib/engines/common/evas_font.h b/legacy/evas/src/lib/engines/common/evas_font.h index dc6992db72..ed6655bef5 100644 --- a/legacy/evas/src/lib/engines/common/evas_font.h +++ b/legacy/evas/src/lib/engines/common/evas_font.h @@ -2,7 +2,8 @@ #define _EVAS_FONT_H #include "evas_text_utils.h" - +/* The tangent of the slant angle we do on runtime. */ +#define _EVAS_FONT_SLANT_TAN 0.221694663 /* main */ EAPI void evas_common_font_init (void); diff --git a/legacy/evas/src/lib/engines/common/evas_font_main.c b/legacy/evas/src/lib/engines/common/evas_font_main.c index 1bbf5c3d04..94f4f772f9 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_main.c +++ b/legacy/evas/src/lib/engines/common/evas_font_main.c @@ -342,7 +342,8 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx) FT_Error error; const FT_Int32 hintflags[3] = { FT_LOAD_NO_HINTING, FT_LOAD_FORCE_AUTOHINT, FT_LOAD_NO_AUTOHINT }; - static FT_Matrix transform = {0x10000, 0x05000, 0x0000, 0x10000}; // about 12 degree. + static FT_Matrix transform = {0x10000, _EVAS_FONT_SLANT_TAN * 0x10000, + 0x00000, 0x10000}; evas_common_font_int_promote(fi); if (fi->fash) diff --git a/legacy/evas/src/lib/engines/common/evas_font_query.c b/legacy/evas/src/lib/engines/common/evas_font_query.c index af2cc844f4..cd54a29243 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_query.c +++ b/legacy/evas/src/lib/engines/common/evas_font_query.c @@ -331,11 +331,24 @@ evas_common_font_query_advance(RGBA_Font *fn, const Evas_Text_Props *text_props, Evas_Coord ret_adv = 0; if (text_props->len > 0) { + RGBA_Font_Int *fi = text_props->font_instance; const Evas_Font_Glyph_Info *glyph = text_props->info->glyph + text_props->start; - ret_adv = glyph[text_props->len - 1].pen_after; + const Evas_Font_Glyph_Info *last_glyph = glyph + text_props->len - 1; + ret_adv = last_glyph->pen_after; if (text_props->start > 0) ret_adv -= glyph[-1].pen_after; + +#if 0 + /* Runtime slant adjustment. */ + if (fi->runtime_rend & FONT_REND_SLANT) + { + RGBA_Font_Glyph *fg = + evas_common_font_int_cache_glyph_get(fi, last_glyph->index); + if (!fg->glyph_out) evas_common_font_int_cache_glyph_render(fg); + ret_adv += fg->glyph_out->bitmap.rows * _EVAS_FONT_SLANT_TAN; + } +#endif } if (h_adv) *h_adv = ret_adv;