提交 10f96462 编写于 作者: B Behdad Esfahbod

Round when scaling values

Doesn't matter for most users since they should be working in a
fixed sub-pixel scale anyway (ie. 22.10, 26.6, 16.16, etc).
上级 df8f70ae
...@@ -12,8 +12,6 @@ General fixes: ...@@ -12,8 +12,6 @@ General fixes:
- Warn at compile time (and runtime with HB_DEBUG?) if no Unicode / font - Warn at compile time (and runtime with HB_DEBUG?) if no Unicode / font
funcs found / set. funcs found / set.
- Do proper rounding when scaling from font space? May be a non-issue.
- Misc features: - Misc features:
* init/medi/fina/isol for non-cursive scripts * init/medi/fina/isol for non-cursive scripts
......
...@@ -461,7 +461,11 @@ struct hb_font_t { ...@@ -461,7 +461,11 @@ struct hb_font_t {
} }
private: private:
inline hb_position_t em_scale (int16_t v, int scale) { return v * (int64_t) scale / face->get_upem (); } inline hb_position_t em_scale (int16_t v, int scale)
{
unsigned int upem = face->get_upem ();
return (v * (int64_t) scale + upem / 2) / upem;
}
}; };
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册