提交 72873cf5 编写于 作者: S Sascha Brawer 提交者: Behdad Esfahbod

Call hb_font_set_var_coords_normalized() from FT_Face coords

上级 4ebbeb7c
......@@ -36,6 +36,7 @@
#include "hb-cache-private.hh" // Maybe use in the future?
#include FT_ADVANCES_H
#include FT_MULTIPLE_MASTERS_H
#include FT_TRUETYPE_TABLES_H
......@@ -616,6 +617,19 @@ hb_ft_font_create (FT_Face ft_face,
ft_face->size->metrics.y_ppem);
#endif
FT_MM_Var *mm_var = NULL;
if (!FT_Get_MM_Var (ft_face, &mm_var)) {
FT_Fixed coords[mm_var->num_axis];
int hbCoords[mm_var->num_axis];
if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, coords)) {
for (int i = 0; i < mm_var->num_axis; ++i) {
hbCoords[i] = coords[i] >> 2;
}
hb_font_set_var_coords_normalized (font, hbCoords, mm_var->num_axis);
}
}
free (mm_var);
return font;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册