|
|
|
@ -114,8 +114,8 @@ struct hb_font_t |
|
|
|
|
int32_t y_scale; |
|
|
|
|
float slant; |
|
|
|
|
float slant_xy; |
|
|
|
|
unsigned upem; |
|
|
|
|
float upem_inv; |
|
|
|
|
float x_multf; |
|
|
|
|
float y_multf; |
|
|
|
|
int64_t x_mult; |
|
|
|
|
int64_t y_mult; |
|
|
|
|
|
|
|
|
@ -141,12 +141,12 @@ struct hb_font_t |
|
|
|
|
{ return HB_DIRECTION_IS_VERTICAL(direction) ? y_mult : x_mult; } |
|
|
|
|
hb_position_t em_scale_x (int16_t v) { return em_mult (v, x_mult); } |
|
|
|
|
hb_position_t em_scale_y (int16_t v) { return em_mult (v, y_mult); } |
|
|
|
|
hb_position_t em_scalef_x (float v) { return em_scalef (v, x_scale); } |
|
|
|
|
hb_position_t em_scalef_y (float v) { return em_scalef (v, y_scale); } |
|
|
|
|
float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } |
|
|
|
|
float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } |
|
|
|
|
float em_fscalef_x (float v) { return em_fscalef (v, x_scale); } |
|
|
|
|
float em_fscalef_y (float v) { return em_fscalef (v, y_scale); } |
|
|
|
|
hb_position_t em_scalef_x (float v) { return em_multf (v, x_multf); } |
|
|
|
|
hb_position_t em_scalef_y (float v) { return em_multf (v, y_multf); } |
|
|
|
|
float em_fscale_x (int16_t v) { return em_fmult (v, x_multf); } |
|
|
|
|
float em_fscale_y (int16_t v) { return em_fmult (v, y_multf); } |
|
|
|
|
float em_fscalef_x (float v) { return em_fmultf (v, x_multf); } |
|
|
|
|
float em_fscalef_y (float v) { return em_fmultf (v, y_multf); } |
|
|
|
|
hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) |
|
|
|
|
{ return em_mult (v, dir_mult (direction)); } |
|
|
|
|
|
|
|
|
@ -631,23 +631,24 @@ struct hb_font_t |
|
|
|
|
|
|
|
|
|
void mults_changed () |
|
|
|
|
{ |
|
|
|
|
upem = face->get_upem (); |
|
|
|
|
upem_inv = 1.f / upem; |
|
|
|
|
float upem = face->get_upem (); |
|
|
|
|
x_multf = x_scale / upem; |
|
|
|
|
y_multf = y_scale / upem; |
|
|
|
|
bool x_neg = x_scale < 0; |
|
|
|
|
x_mult = (x_neg ? -((int64_t) -x_scale << 16) : ((int64_t) x_scale << 16)) * upem_inv; |
|
|
|
|
x_mult = (x_neg ? -((int64_t) -x_scale << 16) : ((int64_t) x_scale << 16)) / upem; |
|
|
|
|
bool y_neg = y_scale < 0; |
|
|
|
|
y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) * upem_inv; |
|
|
|
|
y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) / upem; |
|
|
|
|
slant_xy = y_scale ? slant * x_scale / y_scale : 0.f; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hb_position_t em_mult (int16_t v, int64_t mult) |
|
|
|
|
{ return (hb_position_t) ((v * mult + 32768) >> 16); } |
|
|
|
|
hb_position_t em_scalef (float v, int scale) |
|
|
|
|
{ return (hb_position_t) roundf (em_fscalef (v, scale)); } |
|
|
|
|
float em_fscalef (float v, int scale) |
|
|
|
|
{ return v * scale * upem_inv; } |
|
|
|
|
float em_fscale (int16_t v, int scale) |
|
|
|
|
{ return (float) v * scale * upem_inv; } |
|
|
|
|
hb_position_t em_multf (float v, float mult) |
|
|
|
|
{ return (hb_position_t) roundf (em_fmultf (v, mult)); } |
|
|
|
|
float em_fmultf (float v, float mult) |
|
|
|
|
{ return v * mult; } |
|
|
|
|
float em_fmult (int16_t v, float mult) |
|
|
|
|
{ return (float) v * mult; } |
|
|
|
|
}; |
|
|
|
|
DECLARE_NULL_INSTANCE (hb_font_t); |
|
|
|
|
|
|
|
|
|