summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSascha Brawer <sascha@brawer.ch>2016-09-13 18:40:07 +0200
committerBehdad Esfahbod <behdad@behdad.org>2016-12-16 19:06:26 -0600
commit72873cf522a6e3bec1b6508d8d20d3d2ce233cd6 (patch)
treeaf67f879ac823fd1f201ed19efa3e417d9044630 /src
parent4ebbeb7c50e5c1e934d230ceacf792602c6eb9b9 (diff)
Call hb_font_set_var_coords_normalized() from FT_Face coords
Diffstat (limited to 'src')
-rw-r--r--src/hb-ft.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index 2b06c59b..30d28c09 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -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;
}