diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-01-25 07:36:33 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-01-25 07:36:33 +0000 |
commit | 8675f5a4f4c77a22a3c5cba37c4335f7bd446c3b (patch) | |
tree | 97b07755e327bf7e5b72b3dbc00e2662af163414 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc | |
parent | f0c59df024ecb9aeb94b5e2b013c1693782e3d9e (diff) |
harfbuzz 1.4.2
git-svn-id: svn://tug.org/texlive/trunk@43048 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc index f127066a6d3..48d6a0efb3f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ft.cc @@ -621,17 +621,22 @@ hb_ft_font_create (FT_Face ft_face, 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)) + FT_Fixed *ft_coords = (FT_Fixed *) calloc (mm_var->num_axis, sizeof (FT_Fixed)); + int *coords = (int *) calloc (mm_var->num_axis, sizeof (int)); + if (coords && ft_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); + if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, ft_coords)) + { + for (unsigned int i = 0; i < mm_var->num_axis; ++i) + coords[i] = ft_coords[i] >>= 2; + + hb_font_set_var_coords_normalized (font, coords, mm_var->num_axis); + } + free (coords); + free (ft_coords); } + free (mm_var); } - free (mm_var); #endif return font; @@ -736,6 +741,20 @@ hb_ft_font_set_funcs (hb_font_t *font) FT_Set_Transform (ft_face, &matrix, NULL); } + unsigned int num_coords; + const int *coords = hb_font_get_var_coords_normalized (font, &num_coords); + if (num_coords) + { + FT_Fixed *ft_coords = (FT_Fixed *) calloc (num_coords, sizeof (FT_Fixed)); + if (ft_coords) + { + for (unsigned int i = 0; i < num_coords; i++) + ft_coords[i] = coords[i] << 2; + FT_Set_Var_Blend_Coordinates (ft_face, num_coords, ft_coords); + free (ft_coords); + } + } + ft_face->generic.data = blob; ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; |