From 7cdd6ab068500aa18de9a856bfbe730d0aac9a27 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 10 Jan 2018 04:33:08 +0100 Subject: [PATCH] Round, instead of floor, when applying variations Hoping this would fix remaining text-rendering-tests failures, but so far no luck. --- src/hb-font-private.hh | 2 +- src/hb-ot-layout-gpos-table.hh | 2 +- src/hb-private.hh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh index d2801fb86..d391f462c 100644 --- a/src/hb-font-private.hh +++ b/src/hb-font-private.hh @@ -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 ()); } }; diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 743767a5c..c8ea6e054 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -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; } } diff --git a/src/hb-private.hh b/src/hb-private.hh index acddd8938..9a1f2c514 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -40,6 +40,7 @@ #define HB_OT_H_IN #endif +#include #include #include #include