additional precision made a difference in extents test
authorMichiharu Ariza <ariza@adobe.com>
Tue, 4 Dec 2018 00:06:58 +0000 (16:06 -0800)
committerMichiharu Ariza <ariza@adobe.com>
Tue, 4 Dec 2018 00:06:58 +0000 (16:06 -0800)
src/hb-cff-interp-common.hh
src/hb-cff2-interp-cs.hh
test/api/test-ot-extents-cff.c

index 396bc8c..f2ccc2b 100644 (file)
@@ -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;
index 8d193d6..935a1a1 100644 (file)
@@ -169,7 +169,7 @@ struct CFF2CSInterpEnv : CSInterpEnv<BlendArg, CFF2Subrs>
     {
       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 ();
index 49b8799..bb70a62 100644 (file)
@@ -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);