product = (uint64_t) y * (uint64_t) x;
/* This can be done quickly with int64_t. */
- return ((int64_t) (product + 32676) / (int64_t) 65536) * sign;
+ return ((int64_t) (product + 32768)
+ / (int64_t) 65536) * sign;
#else
struct sfnt_large_integer temp;
int sign;
/* Now compute the scale. Then, scale up the control value table
values. */
interpreter->scale
- = sfnt_div_fixed (pixel_size, head->units_per_em);
+ = sfnt_div_fixed (pixel_size * 64, head->units_per_em);
/* Set the PPEM. */
interpreter->ppem = pixel_size;
/* Load the control value table. */
for (i = 0; i < interpreter->cvt_size; ++i)
interpreter->cvt[i]
- = sfnt_mul_f26dot6_fixed (cvt->values[i] * 64,
+ = sfnt_mul_f26dot6_fixed (cvt->values[i],
interpreter->scale);
/* Fill in the default values for phase, period and threshold. */
single_width = POP (); \
\
interpreter->state.single_width_value \
- = (interpreter->scale * single_width \
- / 1024); \
+ = sfnt_mul_fixed (single_width, \
+ interpreter->scale); \
}
#define DUP() \
TRAP ("WCVTF out of bounds"); \
\
interpreter->cvt[location] \
- = (interpreter->scale * value \
- / 1024); \
+ = sfnt_mul_fixed (value, \
+ interpreter->scale); \
}
#define JROT() \
f2 += glyph->advance_distortion;
/* Next, scale both up. */
- *s1 = sfnt_mul_f26dot6_fixed (f1 * 64, scale);
- *s2 = sfnt_mul_f26dot6_fixed (f2 * 64, scale);
+ *s1 = sfnt_mul_f26dot6_fixed (f1, scale);
+ *s2 = sfnt_mul_f26dot6_fixed (f2, scale);
/* While not expressly provided in the manual, the phantom points
(at times termed the advance and origin points) represent pixel
tem = glyph->simple->x_coordinates[i];
/* Scale that fword. */
- tem = sfnt_mul_f26dot6_fixed (tem * 64, interpreter->scale);
+ tem = sfnt_mul_f26dot6_fixed (tem, interpreter->scale);
/* Set x_points and x_current. */
zone->x_points[i] = tem;
/* Scale that fword. Make sure not to round Y, as this could
lead to Y spilling over to the next line. */
- tem = sfnt_mul_fixed (tem * 64, interpreter->scale);
+ tem = sfnt_mul_f26dot6_fixed (tem, interpreter->scale);
/* Set y_points and y_current. */
zone->y_points[i] = tem;
if (!(component->flags & 01)) /* ARG_1_AND_2_ARE_WORDS */
{
/* X and Y are signed bytes. */
- x = component->argument1.b * 64;
- y = component->argument2.b * 64;
+ x = component->argument1.b;
+ y = component->argument2.b;
}
else
{
/* X and Y are signed words. */
- x = component->argument1.d * 64;
- y = component->argument2.d * 64;
+ x = component->argument1.d;
+ y = component->argument2.d;
}
/* Now convert X and Y into device coordinates. */
/* Multiply the delta by the interpreter scale factor and
then the tuple scale factor. */
- delta = sfnt_mul_f26dot6_fixed (variation->deltas[j] * 64,
+ delta = sfnt_mul_f26dot6_fixed (variation->deltas[j],
interpreter->scale);
delta = sfnt_mul_fixed_round (delta, scale);
}
if (interpreter->state.single_width_value
- != sfnt_mul_f26dot6_fixed (-64, interpreter->scale))
+ != sfnt_mul_f26dot6_fixed (-1, interpreter->scale))
{
fprintf (stderr, "failed, got %d at scale %d,"
" expected %d\n",
interpreter->state.single_width_value,
interpreter->scale,
- sfnt_mul_f26dot6_fixed (-64, interpreter->scale));
+ sfnt_mul_f26dot6_fixed (-1, interpreter->scale));
return;
}
return 1;
}
-#define FANCY_PPEM 14
-#define EASY_PPEM 14
+#define FANCY_PPEM 12
+#define EASY_PPEM 12
interpreter = NULL;
head = sfnt_read_head_table (fd, font);