|
|
|
@ -1747,11 +1747,11 @@ struct VarData |
|
|
|
|
float *scalars /*OUT */, |
|
|
|
|
unsigned int num_scalars) const |
|
|
|
|
{ |
|
|
|
|
assert (num_scalars == regionIndices.len); |
|
|
|
|
for (unsigned int i = 0; i < num_scalars; i++) |
|
|
|
|
{ |
|
|
|
|
unsigned count = hb_min (num_scalars, regionIndices.len); |
|
|
|
|
for (unsigned int i = 0; i < count; i++) |
|
|
|
|
scalars[i] = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); |
|
|
|
|
} |
|
|
|
|
for (unsigned int i = count; i < num_scalars; i++) |
|
|
|
|
scalars[i] = 0.f; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool sanitize (hb_sanitize_context_t *c) const |
|
|
|
@ -1779,8 +1779,12 @@ struct VariationStore |
|
|
|
|
float get_delta (unsigned int outer, unsigned int inner, |
|
|
|
|
const int *coords, unsigned int coord_count) const |
|
|
|
|
{ |
|
|
|
|
#ifdef HB_NO_VAR |
|
|
|
|
return 0.f; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (unlikely (outer >= dataSets.len)) |
|
|
|
|
return 0.; |
|
|
|
|
return 0.f; |
|
|
|
|
|
|
|
|
|
return (this+dataSets[outer]).get_delta (inner, |
|
|
|
|
coords, coord_count, |
|
|
|
@ -1797,6 +1801,10 @@ struct VariationStore |
|
|
|
|
|
|
|
|
|
bool sanitize (hb_sanitize_context_t *c) const |
|
|
|
|
{ |
|
|
|
|
#ifdef HB_NO_VAR |
|
|
|
|
return true; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
TRACE_SANITIZE (this); |
|
|
|
|
return_trace (c->check_struct (this) && |
|
|
|
|
format == 1 && |
|
|
|
@ -1812,6 +1820,12 @@ struct VariationStore |
|
|
|
|
float *scalars /*OUT*/, |
|
|
|
|
unsigned int num_scalars) const |
|
|
|
|
{ |
|
|
|
|
#ifdef HB_NO_VAR |
|
|
|
|
for (unsigned i = 0; i < num_scalars; i++) |
|
|
|
|
scalars[i] = 0.f; |
|
|
|
|
return; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
(this+dataSets[ivs]).get_scalars (coords, coord_count, this+regions, |
|
|
|
|
&scalars[0], num_scalars); |
|
|
|
|
} |
|
|
|
@ -2154,8 +2168,10 @@ struct Device |
|
|
|
|
{ |
|
|
|
|
case 1: case 2: case 3: |
|
|
|
|
return u.hinting.get_x_delta (font); |
|
|
|
|
#ifndef HB_NO_VAR |
|
|
|
|
case 0x8000: |
|
|
|
|
return u.variation.get_x_delta (font, store); |
|
|
|
|
#endif |
|
|
|
|
default: |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -2166,8 +2182,10 @@ struct Device |
|
|
|
|
{ |
|
|
|
|
case 1: case 2: case 3: |
|
|
|
|
return u.hinting.get_y_delta (font); |
|
|
|
|
#ifndef HB_NO_VAR |
|
|
|
|
case 0x8000: |
|
|
|
|
return u.variation.get_y_delta (font, store); |
|
|
|
|
#endif |
|
|
|
|
default: |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -2180,8 +2198,10 @@ struct Device |
|
|
|
|
switch (u.b.format) { |
|
|
|
|
case 1: case 2: case 3: |
|
|
|
|
return_trace (u.hinting.sanitize (c)); |
|
|
|
|
#ifndef HB_NO_VAR |
|
|
|
|
case 0x8000: |
|
|
|
|
return_trace (u.variation.sanitize (c)); |
|
|
|
|
#endif |
|
|
|
|
default: |
|
|
|
|
return_trace (true); |
|
|
|
|
} |
|
|
|
@ -2191,7 +2211,9 @@ struct Device |
|
|
|
|
union { |
|
|
|
|
DeviceHeader b; |
|
|
|
|
HintingDevice hinting; |
|
|
|
|
#ifndef HB_NO_VAR |
|
|
|
|
VariationDevice variation; |
|
|
|
|
#endif |
|
|
|
|
} u; |
|
|
|
|
public: |
|
|
|
|
DEFINE_SIZE_UNION (6, b); |
|
|
|
|