diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index ec81d628b..1d1f10f2b 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -222,14 +222,14 @@ struct number_t 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 @@ struct number_t } protected: - float value = 0.; + double value = 0.; }; /* byte string */ @@ -439,7 +439,7 @@ struct arg_stack_t : cff_stack_t 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 9642b1e49..53226b227 100644 --- a/src/hb-cff-interp-dict-common.hh +++ b/src/hb-cff-interp-dict-common.hh @@ -78,7 +78,7 @@ struct dict_opset_t : opset_t } /* 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 @@ struct dict_opset_t : opset_t 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 c76d45eaa..915b10cf3 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -37,7 +37,7 @@ struct blend_arg_t : number_t { 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 blends_) @@ -148,16 +148,16 @@ struct cff2_cs_interp_env_t : cs_interp_env_t void set_ivs (unsigned int ivs_) { ivs = ivs_; } bool seen_vsindex () const { return seen_vsindex_; } - float blend_deltas (hb_array_t deltas) const + double blend_deltas (hb_array_t 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 32aefcceb..3c52fb9c2 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -266,14 +266,14 @@ struct cff2_private_blend_encoder_param_t } } - float blend_deltas (hb_array_t deltas) const + double blend_deltas (hb_array_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; }