about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/wrapped32/generated/functions_list.txt15
-rw-r--r--src/wrapped32/generated/wrappedfreetypetypes32.h12
-rw-r--r--src/wrapped32/generated/wrapper32.c6
-rw-r--r--src/wrapped32/generated/wrapper32.h3
-rw-r--r--src/wrapped32/wrappedfreetype.c198
-rw-r--r--src/wrapped32/wrappedfreetype_private.h16
6 files changed, 241 insertions, 9 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 42bab578..bef624bf 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -658,6 +658,7 @@
 #() uFEpu -> uFEpu
 #() uFEpU -> uFEpU
 #() uFEpL -> uFEpL
+#() uFEpp -> uFEpp
 #() uFilp -> uFilp
 #() uFipu -> uFipu
 #() uFuuu -> uFuuu
@@ -1114,6 +1115,7 @@
 #() uFEpip -> uFEpip
 #() uFEpiV -> uFEpiV
 #() uFEpup -> uFEpup
+#() uFEpLL -> uFEpLL
 #() uFuuuu -> uFuuuu
 #() uFuppd -> uFuppd
 #() uFpiip -> uFpiip
@@ -1403,6 +1405,7 @@
 #() iEEipup -> iEEipup
 #() iEEippL -> iEEippL
 #() iEEuupi -> iEEuupi
+#() iFEpiup -> iFEpiup
 #() iEEpipp -> iEEpipp
 #() iFEpipp -> iFEpipp
 #() iEEpipV -> iEEpipV
@@ -2235,6 +2238,7 @@ wrappedfreetype:
   - FT_Done_Face
   - FT_Done_Size
   - FT_Has_PS_Glyph_Names
+  - FT_Reference_Face
 - uFp:
   - FT_Get_Sfnt_Name_Count
 - pFp:
@@ -2252,7 +2256,9 @@ wrappedfreetype:
 - iFpl:
   - FT_Outline_Embolden
 - iFpp:
+  - FT_Done_MM_Var
   - FT_Get_Glyph
+  - FT_Get_MM_Var
   - FT_Get_PS_Font_Info
   - FT_Get_WinFNT_Header
   - FT_New_Size
@@ -2262,6 +2268,8 @@ wrappedfreetype:
   - FT_Set_Charmap
 - uFpL:
   - FT_Get_Char_Index
+- uFpp:
+  - FT_Get_Name_Index
 - LFpp:
   - FT_Get_First_Char
 - pFpi:
@@ -2278,6 +2286,9 @@ wrappedfreetype:
   - FT_Load_Glyph
 - iFpuu:
   - FT_Set_Pixel_Sizes
+- iFpup:
+  - FT_Get_Var_Blend_Coordinates
+  - FT_Set_Var_Blend_Coordinates
 - iFpll:
   - FT_Outline_EmboldenXY
 - iFpLi:
@@ -2286,12 +2297,16 @@ wrappedfreetype:
   - FT_Get_BDF_Property
   - FT_Outline_Decompose
   - FT_Outline_Get_Bitmap
+- uFpLL:
+  - FT_Face_GetCharVariantIndex
 - LFpLp:
   - FT_Get_Next_Char
 - vFpuBLLLL_:
   - FT_Glyph_Get_CBox
 - iFprllll_rll_:
   - FT_Glyph_Transform
+- iFpiup:
+  - FT_Get_Advance
 - iFpuip:
   - FT_Outline_New
 - iFpupu:
diff --git a/src/wrapped32/generated/wrappedfreetypetypes32.h b/src/wrapped32/generated/wrappedfreetypetypes32.h
index bfa0a566..f25d037a 100644
--- a/src/wrapped32/generated/wrappedfreetypetypes32.h
+++ b/src/wrapped32/generated/wrappedfreetypetypes32.h
@@ -21,6 +21,7 @@ typedef int32_t (*iFpu_t)(void*, uint32_t);
 typedef int32_t (*iFpl_t)(void*, intptr_t);
 typedef int32_t (*iFpp_t)(void*, void*);
 typedef uint32_t (*uFpL_t)(void*, uintptr_t);
+typedef uint32_t (*uFpp_t)(void*, void*);
 typedef uintptr_t (*LFpp_t)(void*, void*);
 typedef void* (*pFpi_t)(void*, int32_t);
 typedef int32_t (*iFpBp__t)(void*, struct_p_t*);
@@ -29,12 +30,15 @@ typedef void (*vFppp_t)(void*, void*, void*);
 typedef int32_t (*iFpip_t)(void*, int32_t, void*);
 typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t);
 typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t);
+typedef int32_t (*iFpup_t)(void*, uint32_t, void*);
 typedef int32_t (*iFpll_t)(void*, intptr_t, intptr_t);
 typedef int32_t (*iFpLi_t)(void*, uintptr_t, int32_t);
 typedef int32_t (*iFppp_t)(void*, void*, void*);
+typedef uint32_t (*uFpLL_t)(void*, uintptr_t, uintptr_t);
 typedef uintptr_t (*LFpLp_t)(void*, uintptr_t, void*);
 typedef void (*vFpuBLLLL__t)(void*, uint32_t, struct_LLLL_t*);
 typedef int32_t (*iFprllll_rll__t)(void*, struct_llll_t*, struct_ll_t*);
+typedef int32_t (*iFpiup_t)(void*, int32_t, uint32_t, void*);
 typedef int32_t (*iFpuip_t)(void*, uint32_t, int32_t, void*);
 typedef int32_t (*iFpupu_t)(void*, uint32_t, void*, uint32_t);
 typedef int32_t (*iFpplp_t)(void*, void*, intptr_t, void*);
@@ -49,6 +53,7 @@ typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*);
 	GO(FT_Done_Face, iFp_t) \
 	GO(FT_Done_Size, iFp_t) \
 	GO(FT_Has_PS_Glyph_Names, iFp_t) \
+	GO(FT_Reference_Face, iFp_t) \
 	GO(FT_Get_Sfnt_Name_Count, uFp_t) \
 	GO(FT_Get_Postscript_Name, pFp_t) \
 	GO(FT_Get_X11_Font_Format, pFp_t) \
@@ -59,7 +64,9 @@ typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*);
 	GO(FT_Select_Size, iFpi_t) \
 	GO(FT_Render_Glyph, iFpu_t) \
 	GO(FT_Outline_Embolden, iFpl_t) \
+	GO(FT_Done_MM_Var, iFpp_t) \
 	GO(FT_Get_Glyph, iFpp_t) \
+	GO(FT_Get_MM_Var, iFpp_t) \
 	GO(FT_Get_PS_Font_Info, iFpp_t) \
 	GO(FT_Get_WinFNT_Header, iFpp_t) \
 	GO(FT_New_Size, iFpp_t) \
@@ -68,6 +75,7 @@ typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*);
 	GO(FT_Request_Size, iFpp_t) \
 	GO(FT_Set_Charmap, iFpp_t) \
 	GO(FT_Get_Char_Index, uFpL_t) \
+	GO(FT_Get_Name_Index, uFpp_t) \
 	GO(FT_Get_First_Char, LFpp_t) \
 	GO(FT_Get_Sfnt_Table, pFpi_t) \
 	GO(FT_Glyph_Copy, iFpBp__t) \
@@ -76,14 +84,18 @@ typedef int32_t (*iFppllp_t)(void*, void*, intptr_t, intptr_t, void*);
 	GO(FT_Get_Sfnt_Name, iFpip_t) \
 	GO(FT_Load_Glyph, iFpui_t) \
 	GO(FT_Set_Pixel_Sizes, iFpuu_t) \
+	GO(FT_Get_Var_Blend_Coordinates, iFpup_t) \
+	GO(FT_Set_Var_Blend_Coordinates, iFpup_t) \
 	GO(FT_Outline_EmboldenXY, iFpll_t) \
 	GO(FT_Load_Char, iFpLi_t) \
 	GO(FT_Get_BDF_Property, iFppp_t) \
 	GO(FT_Outline_Decompose, iFppp_t) \
 	GO(FT_Outline_Get_Bitmap, iFppp_t) \
+	GO(FT_Face_GetCharVariantIndex, uFpLL_t) \
 	GO(FT_Get_Next_Char, LFpLp_t) \
 	GO(FT_Glyph_Get_CBox, vFpuBLLLL__t) \
 	GO(FT_Glyph_Transform, iFprllll_rll__t) \
+	GO(FT_Get_Advance, iFpiup_t) \
 	GO(FT_Outline_New, iFpuip_t) \
 	GO(FT_Get_Glyph_Name, iFpupu_t) \
 	GO(FT_New_Face, iFpplp_t) \
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index fcfe537a..0139b26b 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -752,6 +752,7 @@ typedef uint32_t (*uFEpW_t)(x64emu_t*, void*, uint16_t);
 typedef uint32_t (*uFEpu_t)(x64emu_t*, void*, uint32_t);
 typedef uint32_t (*uFEpU_t)(x64emu_t*, void*, uint64_t);
 typedef uint32_t (*uFEpL_t)(x64emu_t*, void*, uintptr_t);
+typedef uint32_t (*uFEpp_t)(x64emu_t*, void*, void*);
 typedef uint32_t (*uFilp_t)(int32_t, intptr_t, void*);
 typedef uint32_t (*uFipu_t)(int32_t, void*, uint32_t);
 typedef uint32_t (*uFuuu_t)(uint32_t, uint32_t, uint32_t);
@@ -1208,6 +1209,7 @@ typedef uint32_t (*uFEpii_t)(x64emu_t*, void*, int32_t, int32_t);
 typedef uint32_t (*uFEpip_t)(x64emu_t*, void*, int32_t, void*);
 typedef uint32_t (*uFEpiV_t)(x64emu_t*, void*, int32_t, void*);
 typedef uint32_t (*uFEpup_t)(x64emu_t*, void*, uint32_t, void*);
+typedef uint32_t (*uFEpLL_t)(x64emu_t*, void*, uintptr_t, uintptr_t);
 typedef uint32_t (*uFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t);
 typedef uint32_t (*uFuppd_t)(uint32_t, void*, void*, double);
 typedef uint32_t (*uFpiip_t)(void*, int32_t, int32_t, void*);
@@ -1497,6 +1499,7 @@ typedef int32_t (*iEEipuu_t)(x64emu_t*, int32_t, void*, uint32_t, uint32_t);
 typedef int32_t (*iEEipup_t)(x64emu_t*, int32_t, void*, uint32_t, void*);
 typedef int32_t (*iEEippL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t);
 typedef int32_t (*iEEuupi_t)(x64emu_t*, uint32_t, uint32_t, void*, int32_t);
+typedef int32_t (*iFEpiup_t)(x64emu_t*, void*, int32_t, uint32_t, void*);
 typedef int32_t (*iEEpipp_t)(x64emu_t*, void*, int32_t, void*, void*);
 typedef int32_t (*iFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*);
 typedef int32_t (*iEEpipV_t)(x64emu_t*, void*, int32_t, void*, void*);
@@ -2918,6 +2921,7 @@ void uFEpW_32(x64emu_t *emu, uintptr_t fcn) { uFEpW_t fn = (uFEpW_t)fcn; R_EAX =
 void uFEpu_32(x64emu_t *emu, uintptr_t fcn) { uFEpu_t fn = (uFEpu_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); }
 void uFEpU_32(x64emu_t *emu, uintptr_t fcn) { uFEpU_t fn = (uFEpU_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint64_t, R_ESP + 8)); }
 void uFEpL_32(x64emu_t *emu, uintptr_t fcn) { uFEpL_t fn = (uFEpL_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8))); }
+void uFEpp_32(x64emu_t *emu, uintptr_t fcn) { uFEpp_t fn = (uFEpp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); }
 void uFilp_32(x64emu_t *emu, uintptr_t fcn) { uFilp_t fn = (uFilp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); }
 void uFipu_32(x64emu_t *emu, uintptr_t fcn) { uFipu_t fn = (uFipu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); }
 void uFuuu_32(x64emu_t *emu, uintptr_t fcn) { uFuuu_t fn = (uFuuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); }
@@ -3374,6 +3378,7 @@ void uFEpii_32(x64emu_t *emu, uintptr_t fcn) { uFEpii_t fn = (uFEpii_t)fcn; R_EA
 void uFEpip_32(x64emu_t *emu, uintptr_t fcn) { uFEpip_t fn = (uFEpip_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
 void uFEpiV_32(x64emu_t *emu, uintptr_t fcn) { uFEpiV_t fn = (uFEpiV_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptrv(R_ESP + 12)); }
 void uFEpup_32(x64emu_t *emu, uintptr_t fcn) { uFEpup_t fn = (uFEpup_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); }
+void uFEpLL_32(x64emu_t *emu, uintptr_t fcn) { uFEpLL_t fn = (uFEpLL_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12))); }
 void uFuuuu_32(x64emu_t *emu, uintptr_t fcn) { uFuuuu_t fn = (uFuuuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); }
 void uFuppd_32(x64emu_t *emu, uintptr_t fcn) { uFuppd_t fn = (uFuppd_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(double, R_ESP + 16)); }
 void uFpiip_32(x64emu_t *emu, uintptr_t fcn) { uFpiip_t fn = (uFpiip_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
@@ -3663,6 +3668,7 @@ void iEEipuu_32(x64emu_t *emu, uintptr_t fcn) { iEEipuu_t fn = (iEEipuu_t)fcn; e
 void iEEipup_32(x64emu_t *emu, uintptr_t fcn) { iEEipup_t fn = (iEEipup_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; }
 void iEEippL_32(x64emu_t *emu, uintptr_t fcn) { iEEippL_t fn = (iEEippL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; }
 void iEEuupi_32(x64emu_t *emu, uintptr_t fcn) { iEEuupi_t fn = (iEEuupi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); emu->libc_err = errno; }
+void iFEpiup_32(x64emu_t *emu, uintptr_t fcn) { iFEpiup_t fn = (iFEpiup_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iEEpipp_32(x64emu_t *emu, uintptr_t fcn) { iEEpipp_t fn = (iEEpipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; }
 void iFEpipp_32(x64emu_t *emu, uintptr_t fcn) { iFEpipp_t fn = (iFEpipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iEEpipV_32(x64emu_t *emu, uintptr_t fcn) { iEEpipV_t fn = (iEEpipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index a092568c..59e28768 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -699,6 +699,7 @@ void uFEpW_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpu_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpU_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpL_32(x64emu_t *emu, uintptr_t fnc);
+void uFEpp_32(x64emu_t *emu, uintptr_t fnc);
 void uFilp_32(x64emu_t *emu, uintptr_t fnc);
 void uFipu_32(x64emu_t *emu, uintptr_t fnc);
 void uFuuu_32(x64emu_t *emu, uintptr_t fnc);
@@ -1155,6 +1156,7 @@ void uFEpii_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpip_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpiV_32(x64emu_t *emu, uintptr_t fnc);
 void uFEpup_32(x64emu_t *emu, uintptr_t fnc);
+void uFEpLL_32(x64emu_t *emu, uintptr_t fnc);
 void uFuuuu_32(x64emu_t *emu, uintptr_t fnc);
 void uFuppd_32(x64emu_t *emu, uintptr_t fnc);
 void uFpiip_32(x64emu_t *emu, uintptr_t fnc);
@@ -1444,6 +1446,7 @@ void iEEipuu_32(x64emu_t *emu, uintptr_t fnc);
 void iEEipup_32(x64emu_t *emu, uintptr_t fnc);
 void iEEippL_32(x64emu_t *emu, uintptr_t fnc);
 void iEEuupi_32(x64emu_t *emu, uintptr_t fnc);
+void iFEpiup_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpipp_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpipp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpipV_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedfreetype.c b/src/wrapped32/wrappedfreetype.c
index b6990830..f1b0d2d6 100644
--- a/src/wrapped32/wrappedfreetype.c
+++ b/src/wrapped32/wrappedfreetype.c
@@ -19,6 +19,8 @@
 #include "myalign32.h"
 #include "converter32.h"
 
+#include "khash.h"
+
 static const char* freetypeName = 
 #ifdef ANDROID
     "libfreetype.so"
@@ -497,6 +499,32 @@ typedef struct  TT_PCLT_s
     uint8_t         SerifStyle;
     uint8_t         Reserved;
 } TT_PCLT_t;
+
+typedef struct  FT_Var_Axis_s
+{
+    void*           name;    //string
+    long            minimum;
+    long            def;
+    long            maximum;
+    unsigned long   tag;
+    uint32_t        strid;
+} FT_Var_Axis_t;
+
+typedef struct  FT_Var_Named_Style_s
+{
+    long*      coords;  // one entry per axis
+    uint32_t   strid;
+    uint32_t   psid;
+} FT_Var_Named_Style_t;
+
+typedef struct  FT_MM_Var_s
+{
+    uint32_t                num_axis;
+    uint32_t                num_designs;
+    uint32_t                num_namedstyles;
+    FT_Var_Axis_t*          axis;
+    FT_Var_Named_Style_t*   namedstyle;
+} FT_MM_Var_t;
 // ===============================================
 // 32bits FreeType structures
 // ===============================================
@@ -967,6 +995,32 @@ typedef struct  TT_PCLT_32_s    //no align
     uint8_t         Reserved;
 } TT_PCLT_32_t;
 
+typedef struct  FT_Var_Axis_32_s
+{
+    ptr_t      name;    //string
+    long_t     minimum;
+    long_t     def;
+    long_t     maximum;
+    ulong_t    tag;
+    uint32_t   strid;
+} FT_Var_Axis_32_t;
+
+typedef struct  FT_Var_Named_Style_32_s
+{
+    ptr_t      coords;  // long_t*
+    uint32_t   strid;
+    uint32_t   psid;
+} FT_Var_Named_Style_32_t;
+
+typedef struct  FT_MM_Var_32_s
+{
+    uint32_t    num_axis;
+    uint32_t    num_designs;
+    uint32_t    num_namedstyles;
+    ptr_t       axis;    //FT_Var_Axis_32_t*
+    ptr_t       namedstyle; //FT_Var_Named_Style_32_t*
+} FT_MM_Var_32_t;
+
 // ==================================
 // Convertions
 // ==================================
@@ -2319,10 +2373,43 @@ EXPORT int my32_FT_Get_BDF_Property(x64emu_t* emu, void* face, void* name, BDF_P
     return ret;
 }
 
+KHASH_MAP_INIT_INT(face_ref, uintptr_t);
+
+static kh_face_ref_t *face_ref = NULL;
+
+EXPORT int my32_FT_Reference_Face(x64emu_t* emu, void* face)
+{
+    inplace_FT_FaceRec_enlarge(face);
+    int ret = my->FT_Reference_Face(face);
+    inplace_FT_FaceRec_shrink(face);
+    if(!ret) {
+        if(!face_ref) face_ref = kh_init(face_ref);
+    }
+    khint_t k = kh_get(face_ref, face_ref, (uintptr_t)face);
+    if(k==kh_end(face_ref)) {
+        int ret;
+        k = kh_put(face_ref, face_ref, (uintptr_t)face, &ret);
+        kh_value(face_ref, k) = 0;
+    }
+    ++kh_value(face_ref, k);
+    return ret;
+}
+
 EXPORT int my32_FT_Done_Face(x64emu_t* emu, void* face)
 {
+    int will_free = 0;
+    khint_t k;
+    if(face_ref && ((k=kh_get(face_ref, face_ref, (uintptr_t)face)!=kh_end(face_ref))))
+        will_free = 1;
     inplace_FT_FaceRec_enlarge(face);
-    return my->FT_Done_Face(face);
+    int ret = my->FT_Done_Face(face);
+    if(!will_free) {
+        inplace_FT_FaceRec_shrink(face);
+        --kh_value(face_ref, k);
+        if(!kh_value(face_ref, k))
+            kh_del(face_ref, face_ref, k);
+    }
+    return ret;
 }
 
 EXPORT void my32_FT_Set_Transform(x64emu_t* emu, void* face, FT_Matrix_32_t* matrix, FT_Vector_32_t* delta)
@@ -2411,6 +2498,115 @@ EXPORT int my32_FT_Set_Charmap(x64emu_t* emu, void* face, void* charmap)
     return ret;
 }
 
+EXPORT int my32_FT_Get_Advance(x64emu_t* emu, void* face, uint32_t gindex, int load_flags, long_t*padvance)
+{
+    signed long advance_l = 0;
+    inplace_FT_FaceRec_enlarge(face);
+    int ret = my->FT_Get_Advance(face, gindex, load_flags, &advance_l);
+    inplace_FT_FaceRec_shrink(face);
+    *padvance = to_long(advance_l);
+    return ret;
+}
+
+EXPORT int my32_FT_Get_MM_Var(x64emu_t* emu, void* face, FT_MM_Var_32_t* amaster)
+{
+    FT_MM_Var_t* amaster_l = NULL;
+    inplace_FT_FaceRec_enlarge(face);
+    int ret = my->FT_Get_MM_Var(face, amaster_l);
+    inplace_FT_FaceRec_shrink(face);
+    if(!amaster_l) return ret;
+    // create a 32bits structure...
+    size_t sz = sizeof(FT_MM_Var_32_t)+sizeof(void*);
+    if(amaster_l->axis)
+        sz += amaster_l->num_axis*sizeof(FT_Var_Axis_32_t);
+    if(amaster->namedstyle)
+        sz += amaster_l->num_namedstyles*(sizeof(FT_Var_Named_Style_32_t) + amaster_l->num_axis*sizeof(long_t));
+    void* p = box32_calloc(1, sz);
+    amaster = p; p += sizeof(FT_MM_Var_32_t);
+    *(void**)p = amaster_l; // save original value
+    p += sizeof(void*);
+    amaster->num_axis = amaster_l->num_axis;
+    amaster->num_designs = amaster_l->num_designs;
+    amaster->num_namedstyles = amaster_l->num_namedstyles;
+    if(amaster_l->axis) {
+        amaster->axis = to_ptrv(p);
+        FT_Var_Axis_32_t* axis = p;
+        p += amaster_l->num_axis*sizeof(FT_Var_Axis_32_t);
+        for(int i=0; i<amaster_l->num_axis; ++i) {
+            axis[i].name = to_cstring(amaster_l->axis[i].name);
+            axis[i].minimum = to_long(amaster_l->axis[i].minimum);
+            axis[i].def = to_long(amaster_l->axis[i].def);
+            axis[i].maximum = to_long(amaster_l->axis[i].maximum);
+            axis[i].tag = to_ulong(amaster_l->axis[i].tag);
+            axis[i].strid = amaster_l->axis[i].strid;
+        }
+    } else
+        amaster->axis = 0;
+    if(amaster_l->namedstyle) {
+        amaster->axis = to_ptrv(p);
+        FT_Var_Named_Style_32_t* axis = p;
+        p += amaster_l->num_axis*sizeof(FT_Var_Named_Style_32_t);
+        for(int i=0; i<amaster_l->num_namedstyles; ++i) {
+            axis[i].coords = to_ptrv(p);
+            long_t* coords = p;
+            p += sizeof(long_t)*amaster_l->num_axis;
+            for(int j=0; j<amaster_l->num_axis; ++j)
+                coords[j] = to_long(amaster_l->namedstyle[i].coords[j]);
+        }
+    } else
+        amaster->namedstyle = 0;
+    return ret;
+}
+
+EXPORT int my32_FT_Done_MM_Var(x64emu_t* emu, void* face, FT_MM_Var_32_t* amaster)
+{
+    inplace_FT_FaceRec_enlarge(face);
+    void* amaster_l = amaster+1;
+    int ret = my->FT_Done_MM_Var(face, amaster_l);
+    inplace_FT_FaceRec_shrink(face);
+    box32_free(amaster);    // should check result first?
+    return ret;
+}
+
+EXPORT int my32_FT_Set_Var_Blend_Coordinates(x64emu_t* emu, void* face, uint32_t num_coords, long_t* coords)
+{
+    long coords_l[num_coords];
+    for(int i=0; i<num_coords; ++i)
+        coords_l[i] = from_long(coords[i]);
+    inplace_FT_FaceRec_enlarge(face);
+    int ret = my->FT_Set_Var_Blend_Coordinates(face, num_coords, coords_l);
+    inplace_FT_FaceRec_shrink(face);
+    return ret;
+}
+
+EXPORT int my32_FT_Get_Var_Blend_Coordinates(x64emu_t* emu, void* face, uint32_t num_coords, long_t* coords)
+{
+    long coords_l[num_coords];
+    memset(coords_l, 0, sizeof(coords_l));
+    inplace_FT_FaceRec_enlarge(face);
+    int ret = my->FT_Get_Var_Blend_Coordinates(face, num_coords, coords_l);
+    inplace_FT_FaceRec_shrink(face);
+    for(int i=0; i<num_coords; ++i)
+        coords[i] = to_long(coords_l[i]);
+    return ret;
+}
+
+EXPORT uint32_t my32_FT_Face_GetCharVariantIndex(x64emu_t* emu, void* face, unsigned long charcode, unsigned long variantSel)
+{
+    inplace_FT_FaceRec_enlarge(face);
+    uint32_t ret = my->FT_Face_GetCharVariantIndex(face, charcode, variantSel);
+    inplace_FT_FaceRec_shrink(face);
+    return ret;
+}
+
+EXPORT uint32_t my32_FT_Get_Name_Index(x64emu_t* emu, void* face, void* name)
+{
+    inplace_FT_FaceRec_enlarge(face);
+    uint32_t ret = my->FT_Get_Name_Index(face, name);
+    inplace_FT_FaceRec_shrink(face);
+    return ret;
+}
+
 EXPORT void my32_FT_Outline_Get_CBox(x64emu_t* emu, FT_Outline_32_t* outline, FT_BBox_32_t* bbox)
 {
     FT_Outline_t outline_l = {0};
diff --git a/src/wrapped32/wrappedfreetype_private.h b/src/wrapped32/wrappedfreetype_private.h
index 177f048c..0a9e8438 100644
--- a/src/wrapped32/wrappedfreetype_private.h
+++ b/src/wrapped32/wrappedfreetype_private.h
@@ -26,18 +26,18 @@ GOM(FT_Done_Face, iFEp)
 GO(FT_Done_FreeType, iFp)
 GOM(FT_Done_Glyph, vFEp)
 //GO(FT_Done_Library, iFp)
-//GO(FT_Done_MM_Var, iFpp)
+GOM(FT_Done_MM_Var, iFEpp)
 GOM(FT_Done_Size, iFEp)
 //GO(FT_Face_CheckTrueTypePatents, 
 //GO(FT_Face_GetCharsOfVariant, 
-//GO(FT_Face_GetCharVariantIndex, uFpuu)
+GOM(FT_Face_GetCharVariantIndex, uFEpLL)
 //GO(FT_Face_GetCharVariantIsDefault, 
 //GO(FT_Face_GetVariantSelectors, 
 //GO(FT_Face_GetVariantsOfChar, 
 //GO(FT_Face_Properties, iFpup)
 //GO(FT_Face_SetUnpatentedHinting, 
 GO(FT_FloorFix, lFl)
-//GO(FT_Get_Advance, iFpiup)
+GOM(FT_Get_Advance, iFEpiup)
 //GO(FT_Get_Advances, iFpuuip)
 //GO(FT_Get_BDF_Charset_ID, 
 GOM(FT_Get_BDF_Property, iFEppp)
@@ -60,10 +60,10 @@ GOM(FT_Get_Glyph, iFEpp)
 GOM(FT_Get_Glyph_Name, iFEpupu)
 GOM(FT_Get_Kerning, iFEpuuup)
 //GO(FT_Get_MM_Blend_Coordinates, 
-//GO(FT_Get_MM_Var, iFpp)
+GOM(FT_Get_MM_Var, iFEpp)
 //GO(FT_Get_Module, pFpp)
 //GO(FT_Get_Multi_Master, 
-//GO(FT_Get_Name_Index, uFpp)
+GOM(FT_Get_Name_Index, uFEpp)
 GOM(FT_Get_Next_Char, LFEpLp)
 //GO(FT_Get_Paint, iFppip)    // FT_OpaquePaint is a struct with "pi"
 //GO(FT_Get_Paint_Layers, iFppp)
@@ -83,7 +83,7 @@ GOM(FT_Get_Sfnt_Table, pFEpi)
 //GO(FT_Get_Track_Kerning, iFplip)
 //GO(FT_Get_Transform, vFppp)
 GO(FT_Get_TrueType_Engine_Type, uFp)
-//GO(FT_Get_Var_Blend_Coordinates, iFpup)
+GOM(FT_Get_Var_Blend_Coordinates, iFEpup)
 //GO(FT_Get_Var_Design_Coordinates, 
 GOM(FT_Get_WinFNT_Header, iFEpp)
 GOM(FT_Get_X11_Font_Format, pFEp)
@@ -145,7 +145,7 @@ GOM(FT_Outline_Translate, vFEpll)
 //GO(FT_Palette_Select, iFpWp)
 //GO(FT_Property_Get, iFpppp)
 GO(FT_Property_Set, iFpppp)
-//GO(FT_Reference_Face, iFp)
+GOM(FT_Reference_Face, iFEp)
 //GO(FT_Reference_Library, 
 //GO(FT_Remove_Module, iFpp)
 GOM(FT_Render_Glyph, iFEpu)
@@ -162,7 +162,7 @@ GOM(FT_Set_Char_Size, iFEplluu)
 GOM(FT_Set_Pixel_Sizes, iFEpuu)
 //GO(FT_Set_Renderer, iFppup)
 GOM(FT_Set_Transform, vFEppp)
-//GO(FT_Set_Var_Blend_Coordinates, 
+GOM(FT_Set_Var_Blend_Coordinates, iFEpup)
 //GO(FT_Set_Var_Design_Coordinates, iFpup)
 //GO(FT_Sfnt_Table_Info, iFpupp)
 //GO(FT_Sin, lFl)