1 2 // Copyright Michael D. Parker 2018. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 module bindbc.freetype.bind.ftmm; 8 9 import bindbc.freetype.config; 10 import bindbc.freetype.bind.freetype, 11 bindbc.freetype.bind.fttypes; 12 13 struct FT_MM_Axis { 14 FT_String* name; 15 FT_Long minimum; 16 FT_Long maximum; 17 } 18 19 struct FT_Multi_Master { 20 FT_UInt num_axis; 21 FT_UInt num_designs; 22 FT_MM_Axis[4] axis; 23 } 24 25 struct FT_Var_Axis { 26 FT_String* name; 27 FT_Fixed minimum; 28 FT_Fixed def; 29 FT_Fixed maximum; 30 FT_ULong tag; 31 FT_UInt strid; 32 } 33 34 struct FT_Var_Named_Style { 35 FT_Fixed* coords; 36 FT_UInt strid; 37 static if(ftSupport >= FTSupport.ft27) { 38 FT_UInt psid; 39 } 40 } 41 42 struct FT_MM_Var { 43 FT_UInt num_axis; 44 FT_UInt num_designs; 45 FT_UInt num_namedstyles; 46 FT_Var_Axis* axis; 47 FT_Var_Named_Style* namedstyle; 48 } 49 50 // Added in Freetype 2.8 51 enum FT_VAR_AXIS_FLAG_HIDDEN = 1; 52 53 version(BindFT_Static) { 54 extern(C) @nogc nothrow { 55 FT_Error FT_Get_Multi_Master(FT_Face,FT_Multi_Master*); 56 FT_Error FT_Get_MM_Var(FT_Face,FT_MM_Var**); 57 FT_Error FT_Set_MM_Design_Coordinates(FT_Face,FT_UInt,FT_Long*); 58 FT_Error FT_Set_Var_Design_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 59 FT_Error FT_Set_MM_Blend_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 60 FT_Error FT_Set_Var_Blend_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 61 62 static if(ftSupport >= FTSupport.ft27) { 63 FT_Error FT_Get_Var_Design_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 64 FT_Error FT_Get_MM_Blend_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 65 FT_Error FT_Get_Var_Blend_Coordinates(FT_Face,FT_UInt,FT_Fixed*); 66 } 67 68 static if(ftSupport >= FTSupport.ft28) { 69 FT_Error FT_Get_Var_Axis_Flags(FT_MM_Var*,FT_UInt,FT_UInt*); 70 } 71 72 static if(ftSupport >= FTSupport.ft29) { 73 FT_Error FT_Done_MM_Var(FT_Library,FT_MM_Var*); 74 FT_Error FT_Set_Named_Instance(FT_Face,FT_UInt); 75 } 76 } 77 } 78 else { 79 extern(C) @nogc nothrow { 80 alias pFT_Get_Multi_Master = FT_Error function(FT_Face,FT_Multi_Master*); 81 alias pFT_Get_MM_Var = FT_Error function(FT_Face,FT_MM_Var**); 82 alias pFT_Set_MM_Design_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Long*); 83 alias pFT_Set_Var_Design_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 84 alias pFT_Set_MM_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 85 alias pFT_Set_Var_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 86 87 static if(ftSupport >= FTSupport.ft27) { 88 alias pFT_Get_Var_Design_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 89 alias pFT_Get_MM_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 90 alias pFT_Get_Var_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*); 91 } 92 93 static if(ftSupport >= FTSupport.ft28) { 94 alias pFT_Get_Var_Axis_Flags = FT_Error function(FT_MM_Var*,FT_UInt,FT_UInt*); 95 } 96 97 static if(ftSupport >= FTSupport.ft29) { 98 alias pFT_Done_MM_Var = FT_Error function(FT_Library,FT_MM_Var*); 99 alias pFT_Set_Named_Instance = FT_Error function(FT_Face,FT_UInt); 100 } 101 } 102 103 __gshared { 104 pFT_Get_Multi_Master FT_Get_Multi_Master; 105 pFT_Get_MM_Var FT_Get_MM_Var; 106 pFT_Set_MM_Design_Coordinates FT_Set_MM_Design_Coordinates; 107 pFT_Set_Var_Design_Coordinates FT_Set_Var_Design_Coordinates; 108 pFT_Set_MM_Blend_Coordinates FT_Set_MM_Blend_Coordinates; 109 pFT_Set_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates; 110 111 static if(ftSupport >= FTSupport.ft27) { 112 pFT_Get_Var_Design_Coordinates FT_Get_Var_Design_Coordinates; 113 pFT_Get_MM_Blend_Coordinates FT_Get_MM_Blend_Coordinates; 114 pFT_Get_Var_Blend_Coordinates FT_Get_Var_Blend_Coordinates; 115 } 116 117 static if(ftSupport >= FTSupport.ft28) { 118 pFT_Get_Var_Axis_Flags FT_Get_Var_Axis_Flags; 119 } 120 121 static if(ftSupport >= FTSupport.ft29) { 122 pFT_Done_MM_Var FT_Done_MM_Var; 123 pFT_Set_Named_Instance FT_Set_Named_Instance; 124 } 125 } 126 127 }