Round, instead of floor, when applying variations

Hoping this would fix remaining text-rendering-tests failures,
but so far no luck.
This commit is contained in:
Behdad Esfahbod 2018-01-10 04:33:08 +01:00
parent 6dc6f0c9f8
commit 7cdd6ab068
3 changed files with 3 additions and 2 deletions

View File

@ -541,7 +541,7 @@ struct hb_font_t {
}
inline hb_position_t em_scalef (float v, int scale)
{
return (hb_position_t) (v * scale / face->get_upem ());
return (hb_position_t) round (v * scale / face->get_upem ());
}
};

View File

@ -333,7 +333,7 @@ struct Anchor
case 1: u.format1.get_anchor (c, glyph_id, x, y); return;
case 2: u.format2.get_anchor (c, glyph_id, x, y); return;
case 3: u.format3.get_anchor (c, glyph_id, x, y); return;
default: return;
default: return;
}
}

View File

@ -40,6 +40,7 @@
#define HB_OT_H_IN
#endif
#include <math.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>