Evas font-engine: Fixed kerning issue and a major rendering bug.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 08:47:16 +0000 (08:47 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 21 Apr 2011 08:47:16 +0000 (08:47 +0000)
Kerning: We are walking the string visually so we don't need to do
anything special for kerning when in rtl, freetype works with "left" and
"right" which we automatically get.

Rendering bug: Cedric found that in some cases there were missing
characters. This was caused because I forgot to convert the kerning from
16.6 fixed point to int.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58783 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_text_utils.c

index 8c2482f..64cee18 100644 (file)
@@ -359,26 +359,11 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
         if ((use_kerning) && (prev_index) && (index) &&
             (pface == fi->src->ft.face))
           {
-# ifdef BIDI_SUPPORT
-             /* if it's rtl, the kerning matching should be reversed, */
-             /* i.e prev index is now the index and the other way */
-             /* around. There is a slight exception when there are */
-             /* compositing chars involved.*/
-             if (text_props &&
-                 (text_props->bidi.dir != EVAS_BIDI_DIRECTION_RTL))
+             if (evas_common_font_query_kerning(fi, prev_index, index, &kern))
                {
-                  if (evas_common_font_query_kerning(fi, index, prev_index, &kern))
-                    {
-                       (gl_itr - 1)->pen_after += kern;
-                    }
-               }
-             else
-# endif
-               {
-                  if (evas_common_font_query_kerning(fi, prev_index, index, &kern))
-                    {
-                       (gl_itr - 1)->pen_after += kern;
-                    }
+                  pen_x += kern;
+                  (gl_itr - 1)->pen_after +=
+                     EVAS_FONT_ROUND_26_6_TO_INT(kern);
                }
           }