Evas font-engine: Round the fractional coords (instead of floor).
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:42:07 +0000 (10:42 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:42:07 +0000 (10:42 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56508 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_font_ot_walk.x
src/lib/engines/common/evas_font_private.h

index 5daec80..fed81f7 100644 (file)
 
 /*FIXME: doc */
 #define EVAS_FONT_WALK_OT_X_OFF \
-             (EVAS_FONT_OT_X_OFF_GET( \
-                      intl_props->ot_data->items[char_index]) >> 6)
+             (EVAS_FONT_ROUND_26_6_TO_INT( \
+                EVAS_FONT_OT_X_OFF_GET( \
+                   intl_props->ot_data->items[char_index])))
 #define EVAS_FONT_WALK_OT_Y_OFF \
-             (EVAS_FONT_OT_Y_OFF_GET( \
-                      intl_props->ot_data->items[char_index]) >> 6)
+             (EVAS_FONT_ROUND_26_6_TO_INT( \
+                EVAS_FONT_OT_Y_OFF_GET( \
+                   intl_props->ot_data->items[char_index])))
 #define EVAS_FONT_WALK_OT_X_BEAR (fg->glyph_out->left)
 #define EVAS_FONT_WALK_OT_Y_BEAR (fg->glyph_out->top)
 #define EVAS_FONT_WALK_OT_X_ADV \
-             (EVAS_FONT_OT_X_ADV_GET( \
-                      intl_props->ot_data->items[char_index]) >> 6)
+             (EVAS_FONT_ROUND_26_6_TO_INT( \
+                EVAS_FONT_OT_X_ADV_GET( \
+                   intl_props->ot_data->items[char_index])))
 #define EVAS_FONT_WALK_OT_WIDTH (fg->glyph_out->bitmap.width)
 #define EVAS_FONT_WALK_OT_POS \
              (EVAS_FONT_OT_POS_GET( \
index d3336d1..3eb2465 100644 (file)
@@ -37,6 +37,9 @@ void evas_common_font_int_reload(RGBA_Font_Int *fi);
 #  define OTUNLOCK()
 # endif
 
+# define EVAS_FONT_ROUND_26_6_TO_INT(x) \
+   (((0x3F & x) > 31) ? ((x >> 6) + 1) : (x >> 6))
+
 # define EVAS_FONT_CHARACTER_IS_INVISIBLE(x) ( \
       ((0x200C <= (x)) && ((x) <= 0x200D)) || /* ZWNJ..ZWH */ \
       ((0x200E <= (x)) && ((x) <= 0x200F)) || /* BIDI stuff */ \