#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);
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)
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;