Revert "[cff] Use float instead of double"
This reverts commit c8f67ac28eb18e65adda75818e2c472ad3936874.
Tests failing.
diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh
index ec81d62..1d1f10f 100644
--- a/src/hb-cff-interp-common.hh
+++ b/src/hb-cff-interp-common.hh
@@ -222,14 +222,14 @@
void set_int (int v) { value = v; }
int to_int () const { return value; }
- void set_fixed (int32_t v) { value = v / 65536.0f; }
- int32_t to_fixed () const { return value * 65536.0f; }
+ void set_fixed (int32_t v) { value = v / 65536.0; }
+ int32_t to_fixed () const { return value * 65536.0; }
- void set_real (float v) { value = v; }
- float to_real () const { return value; }
+ void set_real (double v) { value = v; }
+ double to_real () const { return value; }
bool in_int_range () const
- { return ((float) (int16_t) to_int () == value); }
+ { return ((double) (int16_t) to_int () == value); }
bool operator > (const number_t &n) const { return value > n.to_real (); }
bool operator < (const number_t &n) const { return n > *this; }
@@ -244,7 +244,7 @@
}
protected:
- float value = 0.;
+ double value = 0.;
};
/* byte string */
@@ -439,7 +439,7 @@
n.set_fixed (v);
}
- void push_real (float v)
+ void push_real (double v)
{
ARG &n = S::push ();
n.set_real (v);
diff --git a/src/hb-cff-interp-dict-common.hh b/src/hb-cff-interp-dict-common.hh
index 9642b1e..53226b2 100644
--- a/src/hb-cff-interp-dict-common.hh
+++ b/src/hb-cff-interp-dict-common.hh
@@ -78,7 +78,7 @@
}
/* Turns CFF's BCD format into strtod understandable string */
- static float parse_bcd (byte_str_ref_t& str_ref)
+ static double parse_bcd (byte_str_ref_t& str_ref)
{
if (unlikely (str_ref.in_error ())) return .0;
@@ -107,7 +107,7 @@
double pv;
if (unlikely (!hb_parse_double (&p, p + count, &pv, true/* whole buffer */)))
break;
- return (float) pv;
+ return pv;
}
else
{
diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh
index c76d45e..915b10c 100644
--- a/src/hb-cff2-interp-cs.hh
+++ b/src/hb-cff2-interp-cs.hh
@@ -37,7 +37,7 @@
{
void set_int (int v) { reset_blends (); number_t::set_int (v); }
void set_fixed (int32_t v) { reset_blends (); number_t::set_fixed (v); }
- void set_real (float v) { reset_blends (); number_t::set_real (v); }
+ void set_real (double v) { reset_blends (); number_t::set_real (v); }
void set_blends (unsigned int numValues_, unsigned int valueIndex_,
hb_array_t<const blend_arg_t> blends_)
@@ -148,16 +148,16 @@
void set_ivs (unsigned int ivs_) { ivs = ivs_; }
bool seen_vsindex () const { return seen_vsindex_; }
- float blend_deltas (hb_array_t<const ELEM> deltas) const
+ double blend_deltas (hb_array_t<const ELEM> deltas) const
{
- float v = 0;
+ double v = 0;
if (do_blend)
{
if (likely (scalars.length == deltas.length))
{
unsigned count = scalars.length;
for (unsigned i = 0; i < count; i++)
- v += (float) scalars.arrayZ[i] * deltas.arrayZ[i].to_real ();
+ v += (double) scalars.arrayZ[i] * deltas.arrayZ[i].to_real ();
}
}
return v;
diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc
index 32aefcc..3c52fb9 100644
--- a/src/hb-subset-cff2.cc
+++ b/src/hb-subset-cff2.cc
@@ -266,14 +266,14 @@
}
}
- float blend_deltas (hb_array_t<const number_t> deltas) const
+ double blend_deltas (hb_array_t<const number_t> deltas) const
{
- float v = 0;
+ double v = 0;
if (likely (scalars.length == deltas.length))
{
unsigned count = scalars.length;
for (unsigned i = 0; i < count; i++)
- v += (float) scalars.arrayZ[i] * deltas.arrayZ[i].to_real ();
+ v += (double) scalars.arrayZ[i] * deltas.arrayZ[i].to_real ();
}
return v;
}