From 5fff6ab0024547a8ac47723a0047f4b17416d6ce Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Mon, 3 Dec 2018 16:06:58 -0800 Subject: [PATCH] additional precision made a difference in extents test --- src/hb-cff-interp-common.hh | 2 +- src/hb-cff2-interp-cs.hh | 2 +- test/api/test-ot-extents-cff.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index 396bc8c..f2ccc2b 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -229,7 +229,7 @@ struct Number { return (int32_t)(value * 65536.0); } - inline void set_real (double v) { value = (double)v; } + inline void set_real (double v) { value = v; } inline double to_real (void) const { return value; diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index 8d193d6..935a1a1 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -169,7 +169,7 @@ struct CFF2CSInterpEnv : CSInterpEnv { if (likely (scalars.len == arg.deltas.len)) { - float v = arg.to_real (); + double v = arg.to_real (); for (unsigned int i = 0; i < scalars.len; i++) { v += scalars[i] * arg.deltas[i].to_real (); diff --git a/test/api/test-ot-extents-cff.c b/test/api/test-ot-extents-cff.c index 49b8799..bb70a62 100644 --- a/test/api/test-ot-extents-cff.c +++ b/test/api/test-ot-extents-cff.c @@ -171,7 +171,7 @@ test_extents_cff2_vsindex (void) g_assert_cmpint (extents.x_bearing, ==, 11); g_assert_cmpint (extents.y_bearing, ==, 656); g_assert_cmpint (extents.width, ==, 653); - g_assert_cmpint (extents.height, ==, -656); + g_assert_cmpint (extents.height, ==, -657); result = hb_font_get_glyph_extents (font, 2, &extents); g_assert (result); -- 2.7.4