1 /*
2 Boost Software License - Version 1.0 - August 17th, 2003
3 
4 Permission is hereby granted, free of charge, to any person or organization
5 obtaining a copy of the software and accompanying documentation covered by
6 this license (the "Software") to use, reproduce, display, distribute,
7 execute, and transmit the Software, and to prepare derivative works of the
8 Software, and to permit third-parties to whom the Software is furnished to
9 do so, all subject to the following:
10 
11 The copyright notices in the Software and this entire statement, including
12 the above license grant, this restriction and the following disclaimer,
13 must be included in all copies of the Software, in whole or in part, and
14 all derivative works of the Software, unless such copies or derivative
15 works are solely in the form of machine-executable object code generated by
16 a source language processor.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 DEALINGS IN THE SOFTWARE.
25 */
26 
27 module bindbc.freetype.binddynamic;
28 
29 version(BindFreetype_Static) {}
30 else version = BindFreetype_Dynamic;
31 
32 version(BindFreetype_Dynamic):
33 
34 import bindbc.loader;
35 import bindbc.freetype.types;
36 
37 extern(C) @nogc nothrow
38 {
39     // freetype.h
40     alias da_FT_Init_FreeType = FT_Error function(FT_Library*);
41     alias da_FT_Done_FreeType = FT_Error function(FT_Library);
42     alias da_FT_New_Face = FT_Error function(FT_Library,const(char)*,FT_Long,FT_Face*);
43     alias da_FT_New_Memory_Face = FT_Error function(FT_Library,const(FT_Byte)*,FT_Long,FT_Long,FT_Face*);
44     alias da_FT_Open_Face = FT_Error function(FT_Library,const(FT_Open_Args)*,FT_Long,FT_Face*);
45     alias da_FT_Attach_File = FT_Error function(FT_Face,const(char)*);
46     alias da_FT_Attach_Stream = FT_Error function(FT_Face,FT_Open_Args*);
47     alias da_FT_Reference_Face = FT_Error function(FT_Face);
48     alias da_FT_Done_Face = FT_Error function(FT_Face);
49     alias da_FT_Select_Size = FT_Error function(FT_Face,FT_Int);
50     alias da_FT_Request_Size = FT_Error function(FT_Face,FT_Size_Request);
51     alias da_FT_Set_Char_Size = FT_Error function(FT_Face,FT_F26Dot6,FT_F26Dot6,FT_UInt,FT_UInt);
52     alias da_FT_Set_Pixel_Sizes = FT_Error function(FT_Face,FT_UInt,FT_UInt);
53     alias da_FT_Load_Glyph = FT_Error function(FT_Face,FT_UInt,FT_Int32);
54     alias da_FT_Load_Char = FT_Error function(FT_Face,FT_ULong,FT_Int32);
55     alias da_FT_Set_Transform = void function(FT_Face,FT_Matrix*,FT_Vector*);
56     alias da_FT_Render_Glyph = FT_Error function(FT_GlyphSlot,FT_Render_Mode);
57     alias da_FT_Get_Kerning = FT_Error function(FT_Face,FT_UInt,FT_UInt,FT_UInt,FT_Vector*);
58     alias da_FT_Get_Track_Kerning = FT_Error function(FT_Face,FT_Fixed,FT_Int,FT_Fixed*);
59     alias da_FT_Get_Glyph_Name = FT_Error function(FT_Face,FT_UInt,FT_Pointer,FT_UInt);
60     alias da_FT_Get_Postscript_Name = const(char)* function(FT_Face);
61     alias da_FT_Select_Charmap = FT_Error function(FT_Face,FT_Encoding);
62     alias da_FT_Set_Charmap = FT_Error function(FT_Face,FT_CharMap);
63     alias da_FT_Get_Charmap_Index = FT_Int function(FT_CharMap);
64     alias da_FT_Get_Char_Index = FT_UInt function(FT_Face,FT_ULong);
65     alias da_FT_Get_First_Char = FT_ULong function(FT_Face,FT_UInt*);
66     alias da_FT_Get_Next_Char = FT_ULong function(FT_Face,FT_ULong,FT_UInt*);
67     alias da_FT_Get_Name_Index = FT_UInt function(FT_Face,FT_String*);
68     alias da_FT_Get_SubGlyph_Info = FT_Error function(FT_GlyphSlot,FT_UInt,FT_Int*,FT_UInt*,FT_Int*,FT_Int*,FT_Matrix*);
69     alias da_FT_Get_FSType_Flags = FT_UShort function(FT_Face);
70     alias da_FT_Face_GetCharVariantIndex = FT_UInt function(FT_Face,FT_ULong,FT_ULong);
71     alias da_FT_Face_GetCharVariantIsDefault = FT_Int function(FT_Face,FT_ULong,FT_ULong);
72     alias da_FT_Face_GetVariantSelectors = FT_UInt32* function(FT_Face);
73     alias da_FT_Face_GetVariantsOfChar = FT_UInt32* function(FT_Face,FT_ULong);
74     alias da_FT_Face_GetCharsOfVariant = FT_UInt32* function(FT_Face,FT_ULong);
75     alias da_FT_MulDiv = FT_Long function(FT_Long,FT_Long,FT_Long);
76     alias da_FT_MulFix = FT_Long function(FT_Long,FT_Long);
77     alias da_FT_DivFix = FT_Long function(FT_Long,FT_Long);
78     alias da_FT_RoundFix = FT_Fixed function(FT_Fixed);
79     alias da_FT_CeilFix = FT_Fixed function(FT_Fixed);
80     alias da_FT_FloorFix = FT_Fixed function(FT_Fixed);
81     alias da_FT_Vector_Transform = void function(FT_Vector*,FT_Matrix*);
82     alias da_FT_Library_Version = void function(FT_Library,FT_Int*,FT_Int*,FT_Int*);
83     alias da_FT_Face_CheckTrueTypePatents = FT_Bool function(FT_Face);
84     alias da_FT_Face_SetUnpatentedHinting = FT_Bool function(FT_Face,FT_Bool);
85 
86     // ftadvanc.h
87     alias da_FT_Get_Advance = FT_Error function(FT_Face,FT_UInt,FT_Int32,FT_Fixed*);
88     alias da_FT_Get_Advances = FT_Error function(FT_Face,FT_UInt,FT_UInt,FT_Int32,FT_Fixed*);
89 
90     // ftbbox.h
91     alias da_FT_Outline_Get_BBox = FT_Error function(FT_Outline*,FT_BBox);
92 
93     // ftbdf.h
94     version(linux) {
95         alias da_FT_Get_BDF_Charset_ID = FT_Error function(FT_Face,const(char)** acharset_encoding,const(char)** acharset_registry);
96         alias da_FT_Get_BDF_Property = FT_Error function(FT_Face,const(char)*,BDF_PropertyRec*);
97     }
98 
99     // ftbitmap.h
100     alias da_FT_Bitmap_Init = void function(FT_Bitmap*);
101     alias da_FT_Bitmap_Copy = FT_Error function(FT_Library,const(FT_Bitmap)*,FT_Bitmap*);
102     alias da_FT_Bitmap_Embolden = FT_Error function(FT_Library,FT_Bitmap*,FT_Pos,FT_Pos);
103     alias da_FT_Bitmap_Convert = FT_Error function(FT_Library,const(FT_Bitmap)*,FT_Bitmap*,FT_Int);
104     alias da_FT_GlyphSlot_Own_Bitmap = FT_Error function(FT_GlyphSlot);
105     alias da_FT_Bitmap_Done = FT_Error function(FT_Library,FT_Bitmap*);
106 
107     // ftbzip2.h
108     alias da_FT_Stream_OpenBzip2 = FT_Error function(FT_Stream,FT_Stream);
109 
110     // ftcache.h
111     alias da_FTC_Manager_New = FT_Error function(FT_Library,FT_UInt,FT_UInt,FT_ULong,FTC_Face_Requester,FT_Pointer,FTC_Manager*);
112     alias da_FTC_Manager_Reset = void function(FTC_Manager);
113     alias da_FTC_Manager_Done = void function(FTC_Manager);
114     alias da_FTC_Manager_LookupFace = FT_Error function(FTC_Manager,FTC_FaceID,FT_Face*);
115     alias da_FTC_Manager_LookupSize = FT_Error function(FTC_Manager,FTC_Scaler,FT_Size*);
116     alias da_FTC_Node_Unref = void function(FTC_Node,FTC_Manager);
117     alias da_FTC_Manager_RemoveFaceID = void function(FTC_Manager,FTC_FaceID);
118     alias da_FTC_CMapCache_New = FT_Error function(FTC_Manager,FTC_CMapCache*);
119     alias da_FTC_CMapCache_Lookup = FT_UInt function(FTC_CMapCache,FTC_FaceID,FT_Int,FT_UInt32);
120     alias da_FTC_ImageCache_New = FT_Error function(FTC_Manager,FTC_ImageCache*);
121     alias da_FTC_ImageCache_Lookup = FT_Error function(FTC_ImageCache,FTC_ImageType,FT_UInt,FT_Glyph*,FTC_Node*);
122     alias da_FTC_ImageCache_LookupScaler = FT_Error function(FTC_ImageCache,FTC_Scaler,FT_ULong,FT_UInt,FT_Glyph*,FTC_Node*);
123     alias da_FTC_SBitCache_New = FT_Error function(FTC_Manager,FTC_SBitCache*);
124     alias da_FTC_SBitCache_Lookup = FT_Error function(FTC_SBitCache,FTC_ImageType,FT_UInt,FTC_SBit*,FTC_Node*);
125     alias da_FTC_SBitCache_LookupScaler = FT_Error function(FTC_SBitCache,FTC_Scaler,FT_ULong,FT_UInt,FTC_SBit*,FTC_Node*);
126 
127     // ftcid.h
128     alias da_FT_Get_CID_Registry_Ordering_Supplement = FT_Error function(FT_Face,const(char*)*,const(char*)*,FT_Int*);
129     alias da_FT_Get_CID_Is_Internally_CID_Keyed = FT_Error function(FT_Face,FT_Bool*);
130     alias da_FT_Get_CID_From_Glyph_Index = FT_Error function(FT_Face,FT_UInt,FT_UInt*);
131 
132     // ftgasp.h
133     alias da_FT_Get_Gasp = FT_Int function(FT_Face,FT_UInt);
134 
135     // ftglyph.h
136     alias da_FT_Get_Glyph = FT_Error function(FT_GlyphSlot,FT_Glyph*);
137     alias da_FT_Glyph_Copy = FT_Error function(FT_Glyph,FT_Glyph*);
138     alias da_FT_Glyph_Transform = FT_Error function(FT_Glyph,FT_Matrix*,FT_Vector*);
139     alias da_FT_Glyph_Get_CBox = void function(FT_Glyph,FT_UInt,FT_BBox*);
140     alias da_FT_Glyph_To_Bitmap = FT_Error function(FT_Glyph*,FT_Render_Mode,FT_Vector*,FT_Bool);
141     alias da_FT_Done_Glyph = void function(FT_Glyph);
142     alias da_FT_Matrix_Multiply = void function(const(FT_Matrix)*,FT_Matrix*);
143     alias da_FT_Matrix_Invert = FT_Error function(FT_Matrix*);
144 
145     // ftgxval.h
146     alias da_FT_TrueTypeGX_Validate = FT_Error function(FT_Face,FT_UInt,FT_Bytes,FT_UInt);
147     alias da_FT_TrueTypeGX_Free = void function(FT_Face,FT_Bytes);
148     alias da_FT_ClassicKern_Validate = FT_Error function(FT_Face,FT_UInt,FT_Bytes*);
149     alias da_FT_ClassicKern_Free = void function(FT_Face,FT_Bytes);
150 
151     // ftgzip.h
152     alias da_FT_Stream_OpenGzip = FT_Error function(FT_Stream,FT_Stream);
153     alias da_FT_Gzip_Uncompress = FT_Error function(FT_Memory,FT_Byte*,FT_ULong*,const(FT_Byte)*,FT_ULong);
154 
155     // ftlcdfil.h
156     alias da_FT_Library_SetLcdFilter = FT_Error function(FT_Library,FT_LcdFilter);
157     alias da_FT_Library_SetLcdFilterWeights = FT_Error function(FT_Library,ubyte*);
158 
159     alias da_FT_List_Find = FT_ListNode function(FT_List,void*);
160     alias da_FT_List_Add = void function(FT_List,FT_ListNode);
161     alias da_FT_List_Insert = void function(FT_List,FT_ListNode);
162     alias da_FT_List_Remove = void function(FT_List,FT_ListNode);
163     alias da_FT_List_Up = void function(FT_List,FT_ListNode);
164     alias da_FT_List_Iterate = FT_Error function(FT_List,FT_List_Iterator,void*);
165     alias da_FT_List_Finalize = void function(FT_List,FT_List_Destructor,FT_Memory,void*);
166 
167     // ftlzw.h
168     alias da_FT_Stream_OpenLZW = FT_Error function(FT_Stream,FT_Stream);
169 
170     // ftmm.h
171     alias da_FT_Get_Multi_Master = FT_Error function(FT_Face,FT_Multi_Master*);
172     alias da_FT_Get_MM_Var = FT_Error function(FT_Face,FT_MM_Var**);
173     alias da_FT_Set_MM_Design_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Long*);
174     alias da_FT_Set_Var_Design_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*);
175     alias da_FT_Set_MM_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*);
176     alias da_FT_Set_Var_Blend_Coordinates = FT_Error function(FT_Face,FT_UInt,FT_Fixed*);
177 
178     // ftmodapi.h
179     alias da_FT_Add_Module = FT_Error function(FT_Library,const(FT_Module_Class)*);
180     alias da_FT_Get_Module = FT_Module function(FT_Library,const(char)*);
181     alias da_FT_Remove_Module = FT_Error function(FT_Library,FT_Module);
182     alias da_FT_Property_Set = FT_Error function(FT_Library,const(FT_String)*,const(FT_String)*,const(void)*);
183     alias da_FT_Property_Get = FT_Error function(FT_Library,const(FT_String)*,const(FT_String)*,void*);
184     alias da_FT_Reference_Library = FT_Error function(FT_Library);
185     alias da_FT_New_Library = FT_Error function(FT_Memory,FT_Library*);
186     alias da_FT_Done_Library = FT_Error function(FT_Library);
187     alias da_FT_Set_Debug_Hook = void function(FT_Library,FT_UInt,FT_DebugHook_Func);
188     alias da_FT_Add_Default_Modules = void function(FT_Library);
189     alias da_FT_Get_TrueType_Engine_Type = FT_TrueTypeEngineType function(FT_Library);
190 
191     // ftotval.h
192     alias da_FT_OpenType_Validate = FT_Error function(FT_Face,FT_UInt,FT_Bytes*,FT_Bytes*,FT_Bytes*,FT_Bytes*,FT_Bytes*);
193     alias da_FT_OpenType_Free = void function (FT_Face face,FT_Bytes table);
194 
195     // ftoutln.h
196     alias da_FT_Outline_Decompose = FT_Error function(FT_Outline*,const(FT_Outline_Funcs)*,void*);
197     alias da_FT_Outline_New = FT_Error function(FT_Library,FT_UInt,FT_Int,FT_Outline*);
198     alias da_FT_Outline_New_Internal = FT_Error function(FT_Memory,FT_UInt,FT_Int,FT_Outline*);
199     alias da_FT_Outline_Done = FT_Error function(FT_Library,FT_Outline*);
200     alias da_FT_Outline_Done_Internal = FT_Error function(FT_Memory,FT_Outline*);
201     alias da_FT_Outline_Check = FT_Error function(FT_Outline*);
202     alias da_FT_Outline_Get_CBox = void function(const(FT_Outline)*,FT_BBox*);
203     alias da_FT_Outline_Translate = void function(const(FT_Outline)*,FT_Pos,FT_Pos);
204     alias da_FT_Outline_Copy = FT_Error function(const(FT_Outline)*,FT_Outline*);
205     alias da_FT_Outline_Transform = void function(const(FT_Outline)*,const(FT_Matrix)*);
206     alias da_FT_Outline_Embolden = FT_Error function(FT_Outline*,FT_Pos);
207     alias da_FT_Outline_EmboldenXY = FT_Error function(FT_Outline*,FT_Pos,FT_Pos);
208     alias da_FT_Outline_Reverse = void function(FT_Outline*);
209     alias da_FT_Outline_Get_Bitmap = FT_Error function(FT_Library,FT_Outline*,const(FT_Bitmap)*);
210     alias da_FT_Outline_Render = FT_Error function(FT_Library,FT_Outline*,FT_Raster_Params*);
211     alias da_FT_Outline_Get_Orientation = FT_Orientation function(FT_Outline*);
212 
213     // ftpfr.h
214     alias da_FT_Get_PFR_Metrics = FT_Error function(FT_Face,FT_UInt*,FT_UInt*,FT_Fixed*,FT_Fixed*);
215     alias da_FT_Get_PFR_Kerning = FT_Error function(FT_Face,FT_UInt,FT_UInt,FT_Vector*);
216     alias da_FT_Get_PFR_Advance = FT_Error function(FT_Face,FT_UInt,FT_Pos*);
217 
218     // ftrender.h
219     alias da_FT_Get_Renderer = FT_Renderer function(FT_Library,FT_Glyph_Format);
220     alias da_FT_Set_Renderer = FT_Error function(FT_Library,FT_Renderer,FT_UInt,FT_Parameter*);
221 
222     // ftsizes.h
223     alias da_FT_New_Size = FT_Error function(FT_Face,FT_Size*);
224     alias da_FT_Done_Size = FT_Error function(FT_Size);
225     alias da_FT_Activate_Size = FT_Error function(FT_Size);
226 
227     // ftsnames.h
228     alias da_FT_Get_Sfnt_Name_Count = FT_UInt function(FT_Face);
229 
230     // ftstroke.h
231     alias da_FT_Outline_GetInsideBorder = FT_StrokerBorder function(FT_Outline*);
232     alias da_FT_Outline_GetOutsideBorder = FT_StrokerBorder function(FT_Outline*);
233     alias da_FT_Stroker_New = FT_Error function(FT_Memory,FT_Stroker*);
234     alias da_FT_Stroker_Set = void function(FT_Stroker,FT_Fixed,FT_Stroker_LineCap,FT_Stroker_LineJoin,FT_Fixed);
235     alias da_FT_Stroker_Rewind = void function(FT_Stroker);
236     alias da_FT_Stroker_ParseOutline = FT_Error function(FT_Stroker,FT_Outline*,FT_Bool);
237     alias da_FT_Stroker_BeginSubPath = FT_Error function(FT_Stroker,FT_Vector*,FT_Bool);
238     alias da_FT_Stroker_EndSubPath = FT_Error function(FT_Stroker);
239     alias da_FT_Stroker_LineTo = FT_Error function(FT_Stroker,FT_Vector*);
240     alias da_FT_Stroker_ConicTo = FT_Error function(FT_Stroker,FT_Vector*,FT_Vector*);
241     alias da_FT_Stroker_CubicTo = FT_Error function(FT_Stroker,FT_Vector*,FT_Vector*,FT_Vector*);
242     alias da_FT_Stroker_GetBorderCounts = FT_Error function(FT_Stroker,FT_StrokerBorder,FT_UInt*,FT_UInt*);
243     alias da_FT_Stroker_ExportBorder = void function(FT_Stroker,FT_StrokerBorder,FT_Outline*);
244     alias da_FT_Stroker_GetCounts = FT_Error function(FT_Stroker,FT_UInt*,FT_UInt*);
245     alias da_FT_Stroker_Export = void function(FT_Stroker,FT_Outline*);
246     alias da_FT_Stroker_Done = void function(FT_Stroker);
247     alias da_FT_Glyph_Stroke = FT_Error function(FT_Glyph*,FT_Stroker,FT_Bool);
248     alias da_FT_Glyph_StrokeBorder = FT_Error function(FT_Glyph*,FT_Stroker,FT_Bool,FT_Bool);
249 
250     // ftsynth.h
251     alias da_FT_GlyphSlot_Embolden = void function(FT_GlyphSlot);
252     alias da_FT_GlyphSlot_Oblique = void function(FT_GlyphSlot);
253 
254     // fttrigon.h
255     alias da_FT_Sin = FT_Fixed function(FT_Angle);
256     alias da_FT_Cos = FT_Fixed function(FT_Angle);
257     alias da_FT_Tan = FT_Fixed function(FT_Angle);
258     alias da_FT_Atan2 = FT_Angle function(FT_Fixed,FT_Fixed);
259     alias da_FT_Angle_Diff = FT_Angle function(FT_Angle,FT_Angle);
260     alias da_FT_Vector_Unit = void function(FT_Vector*,FT_Angle);
261     alias da_FT_Vector_Rotate = void function(FT_Vector*,FT_Angle);
262     alias da_FT_Vector_Length = FT_Fixed function(FT_Vector*);
263     alias da_FT_Vector_Polarize = void function(FT_Vector*,FT_Fixed*,FT_Angle*);
264     alias da_FT_Vector_From_Polar = void function(FT_Vector*,FT_Fixed,FT_Angle);
265 
266     // ftwinfnt.h
267     alias da_FT_Get_WinFNT_Header = FT_Error function(FT_Face,FT_WinFNT_HeaderRec*);
268 
269     // ftxf86.h
270     alias da_FT_Get_X11_Font_Format = const(char)* function(FT_Face);
271 
272     // t1tables.h
273     alias da_FT_Has_PS_Glyph_Names = FT_Int function(FT_Face);
274     alias da_FT_Get_PS_Font_Info = FT_Error function(FT_Face,PS_FontInfoRec*);
275     alias da_FT_Get_PS_Font_Private = FT_Error function(FT_Face,PS_PrivateRec*);
276     alias da_FT_Get_PS_Font_Value = FT_Long function(FT_Face,PS_Dict_Keys*,FT_UInt,FT_Long);
277 
278     // tttables.h
279     alias da_FT_Get_Sfnt_Table = void* function(FT_Face,FT_Sfnt_Tag);
280     alias da_FT_Load_Sfnt_Table = FT_Error function(FT_Face,FT_ULong,FT_Long,FT_Byte*,FT_ULong*);
281     alias da_FT_Sfnt_Table_Info = FT_Error function(FT_Face,FT_UInt,FT_ULong*,FT_ULong*);
282     alias da_FT_Get_CMap_Language_ID = FT_ULong function(FT_CharMap);
283     alias da_FT_Get_CMap_Format = FT_ULong function(FT_CharMap);
284     alias da_FT_Get_Sfnt_Name = FT_Error function(FT_Face,FT_UInt,FT_SfntName*);
285 }
286 
287 __gshared
288 {
289     da_FT_Init_FreeType FT_Init_FreeType;
290     da_FT_Done_FreeType FT_Done_FreeType;
291     da_FT_New_Face FT_New_Face;
292     da_FT_New_Memory_Face FT_New_Memory_Face;
293     da_FT_Open_Face FT_Open_Face;
294     da_FT_Attach_File FT_Attach_File;
295     da_FT_Attach_Stream FT_Attach_Stream;
296     da_FT_Reference_Face FT_Reference_Face;
297     da_FT_Done_Face FT_Done_Face;
298     da_FT_Select_Size FT_Select_Size;
299     da_FT_Request_Size FT_Request_Size;
300     da_FT_Set_Char_Size FT_Set_Char_Size;
301     da_FT_Set_Pixel_Sizes FT_Set_Pixel_Sizes;
302     da_FT_Load_Glyph FT_Load_Glyph;
303     da_FT_Load_Char FT_Load_Char;
304     da_FT_Set_Transform FT_Set_Transform;
305     da_FT_Render_Glyph FT_Render_Glyph;
306     da_FT_Get_Kerning FT_Get_Kerning;
307     da_FT_Get_Track_Kerning FT_Get_Track_Kerning;
308     da_FT_Get_Glyph_Name FT_Get_Glyph_Name;
309     da_FT_Get_Postscript_Name FT_Get_Postscript_Name;
310     da_FT_Select_Charmap FT_Select_Charmap;
311     da_FT_Set_Charmap FT_Set_Charmap;
312     da_FT_Get_Charmap_Index FT_Get_Charmap_Index;
313     da_FT_Get_Char_Index FT_Get_Char_Index;
314     da_FT_Get_First_Char FT_Get_First_Char;
315     da_FT_Get_Next_Char FT_Get_Next_Char;
316     da_FT_Get_Name_Index FT_Get_Name_Index;
317     da_FT_Get_SubGlyph_Info FT_Get_SubGlyph_Info;
318     da_FT_Get_FSType_Flags FT_Get_FSType_Flags;
319     da_FT_Face_GetCharVariantIndex FT_Face_GetCharVariantIndex;
320     da_FT_Face_GetCharVariantIsDefault FT_Face_GetCharVariantIsDefault;
321     da_FT_Face_GetVariantSelectors FT_Face_GetVariantSelectors;
322     da_FT_Face_GetVariantsOfChar FT_Face_GetVariantsOfChar;
323     da_FT_Face_GetCharsOfVariant FT_Face_GetCharsOfVariant;
324     da_FT_MulDiv FT_MulDiv;
325     da_FT_MulFix FT_MulFix;
326     da_FT_DivFix FT_DivFix;
327     da_FT_RoundFix FT_RoundFix;
328     da_FT_CeilFix FT_CeilFix;
329     da_FT_FloorFix FT_FloorFix;
330     da_FT_Vector_Transform FT_Vector_Transform;
331     da_FT_Library_Version FT_Library_Version;
332     da_FT_Face_CheckTrueTypePatents FT_Face_CheckTrueTypePatents;
333     da_FT_Face_SetUnpatentedHinting FT_Face_SetUnpatentedHinting;
334 
335     da_FT_Get_Advance FT_Get_Advance;
336     da_FT_Get_Advances FT_Get_Advances;
337 
338     da_FT_Outline_Get_BBox FT_Outline_Get_BBox;
339 
340     version(linux) {
341         da_FT_Get_BDF_Charset_ID FT_Get_BDF_Charset_ID;
342         da_FT_Get_BDF_Property FT_Get_BDF_Property;
343     }
344 
345     da_FT_Bitmap_Init FT_Bitmap_Init;
346     da_FT_Bitmap_Copy FT_Bitmap_Copy;
347     da_FT_Bitmap_Embolden FT_Bitmap_Embolden;
348     da_FT_Bitmap_Convert FT_Bitmap_Convert;
349     da_FT_GlyphSlot_Own_Bitmap FT_GlyphSlot_Own_Bitmap;
350     da_FT_Bitmap_Done FT_Bitmap_Done;
351 
352     da_FT_Stream_OpenBzip2 FT_Stream_OpenBzip2;
353 
354     da_FTC_Manager_New FTC_Manager_New;
355     da_FTC_Manager_Reset FTC_Manager_Reset;
356     da_FTC_Manager_Done FTC_Manager_Done;
357     da_FTC_Manager_LookupFace FTC_Manager_LookupFace;
358     da_FTC_Manager_LookupSize FTC_Manager_LookupSize;
359     da_FTC_Node_Unref FTC_Node_Unref;
360     da_FTC_Manager_RemoveFaceID FTC_Manager_RemoveFaceID;
361     da_FTC_CMapCache_New FTC_CMapCache_New;
362     da_FTC_CMapCache_Lookup FTC_CMapCache_Lookup;
363     da_FTC_ImageCache_New FTC_ImageCache_New;
364     da_FTC_ImageCache_Lookup FTC_ImageCache_Lookup;
365     da_FTC_ImageCache_LookupScaler FTC_ImageCache_LookupScaler;
366     da_FTC_SBitCache_New FTC_SBitCache_New;
367     da_FTC_SBitCache_Lookup FTC_SBitCache_Lookup;
368     da_FTC_SBitCache_LookupScaler FTC_SBitCache_LookupScaler;
369 
370     da_FT_Get_CID_Registry_Ordering_Supplement FT_Get_CID_Registry_Ordering_Supplement;
371     da_FT_Get_CID_Is_Internally_CID_Keyed FT_Get_CID_Is_Internally_CID_Keyed;
372     da_FT_Get_CID_From_Glyph_Index FT_Get_CID_From_Glyph_Index;
373 
374     da_FT_Get_Gasp FT_Get_Gasp;
375 
376     da_FT_Get_Glyph FT_Get_Glyph;
377     da_FT_Glyph_Copy FT_Glyph_Copy;
378     da_FT_Glyph_Transform FT_Glyph_Transform;
379     da_FT_Glyph_Get_CBox FT_Glyph_Get_CBox;
380     da_FT_Glyph_To_Bitmap FT_Glyph_To_Bitmap;
381     da_FT_Done_Glyph FT_Done_Glyph;
382     da_FT_Matrix_Multiply FT_Matrix_Multiply;
383     da_FT_Matrix_Invert FT_Matrix_Invert;
384 
385     da_FT_TrueTypeGX_Validate FT_TrueTypeGX_Validate;
386     da_FT_TrueTypeGX_Free FT_TrueTypeGX_Free;
387     da_FT_ClassicKern_Validate FT_ClassicKern_Validate;
388     da_FT_ClassicKern_Free FT_ClassicKern_Free;
389 
390     da_FT_Stream_OpenGzip FT_Stream_OpenGzip;
391     da_FT_Gzip_Uncompress FT_Gzip_Uncompress;
392 
393     da_FT_Library_SetLcdFilter FT_Library_SetLcdFilter;
394     da_FT_Library_SetLcdFilterWeights FT_Library_SetLcdFilterWeights;
395 
396     da_FT_List_Find FT_List_Find;
397     da_FT_List_Add FT_List_Add;
398     da_FT_List_Insert FT_List_Insert;
399     da_FT_List_Remove FT_List_Remove;
400     da_FT_List_Up FT_List_Up;
401     da_FT_List_Iterate FT_List_Iterate;
402     da_FT_List_Finalize FT_List_Finalize;
403 
404     da_FT_Stream_OpenLZW FT_Stream_OpenLZW;
405 
406     da_FT_Get_Multi_Master FT_Get_Multi_Master;
407     da_FT_Get_MM_Var FT_Get_MM_Var;
408     da_FT_Set_MM_Design_Coordinates FT_Set_MM_Design_Coordinates;
409     da_FT_Set_Var_Design_Coordinates FT_Set_Var_Design_Coordinates;
410     da_FT_Set_MM_Blend_Coordinates FT_Set_MM_Blend_Coordinates;
411     da_FT_Set_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates;
412 
413     da_FT_Add_Module FT_Add_Module;
414     da_FT_Get_Module FT_Get_Module;
415     da_FT_Remove_Module FT_Remove_Module;
416     da_FT_Property_Set FT_Property_Set;
417     da_FT_Property_Get FT_Property_Get;
418     da_FT_Reference_Library FT_Reference_Library;
419     da_FT_New_Library FT_New_Library;
420     da_FT_Done_Library FT_Done_Library;
421     da_FT_Set_Debug_Hook FT_Set_Debug_Hook;
422     da_FT_Add_Default_Modules FT_Add_Default_Modules;
423     da_FT_Get_TrueType_Engine_Type FT_Get_TrueType_Engine_Type;
424 
425     da_FT_OpenType_Validate FT_OpenType_Validate;
426     da_FT_OpenType_Free FT_OpenType_Free;
427 
428     da_FT_Outline_Decompose FT_Outline_Decompose;
429     da_FT_Outline_New FT_Outline_New;
430     da_FT_Outline_New_Internal FT_Outline_New_Internal;
431     da_FT_Outline_Done FT_Outline_Done;
432     da_FT_Outline_Done_Internal FT_Outline_Done_Internal;
433     da_FT_Outline_Check FT_Outline_Check;
434     da_FT_Outline_Get_CBox FT_Outline_Get_CBox;
435     da_FT_Outline_Translate FT_Outline_Translate;
436     da_FT_Outline_Copy FT_Outline_Copy;
437     da_FT_Outline_Transform FT_Outline_Transform;
438     da_FT_Outline_Embolden FT_Outline_Embolden;
439     da_FT_Outline_EmboldenXY FT_Outline_EmboldenXY;
440     da_FT_Outline_Reverse FT_Outline_Reverse;
441     da_FT_Outline_Get_Bitmap FT_Outline_Get_Bitmap;
442     da_FT_Outline_Render FT_Outline_Render;
443     da_FT_Outline_Get_Orientation FT_Outline_Get_Orientation;
444 
445     da_FT_Get_PFR_Metrics FT_Get_PFR_Metrics;
446     da_FT_Get_PFR_Kerning FT_Get_PFR_Kerning;
447     da_FT_Get_PFR_Advance FT_Get_PFR_Advance;
448 
449     da_FT_Get_Renderer FT_Get_Renderer;
450     da_FT_Set_Renderer FT_Set_Renderer;
451 
452     da_FT_New_Size FT_New_Size;
453     da_FT_Done_Size FT_Done_Size;
454     da_FT_Activate_Size FT_Activate_Size;
455 
456     da_FT_Get_Sfnt_Name_Count FT_Get_Sfnt_Name_Count;
457     da_FT_Get_Sfnt_Name FT_Get_Sfnt_Name;
458 
459     da_FT_Outline_GetInsideBorder FT_Outline_GetInsideBorder;
460     da_FT_Outline_GetOutsideBorder FT_Outline_GetOutsideBorder;
461     da_FT_Stroker_New FT_Stroker_New;
462     da_FT_Stroker_Set FT_Stroker_Set;
463     da_FT_Stroker_Rewind FT_Stroker_Rewind;
464     da_FT_Stroker_ParseOutline FT_Stroker_ParseOutline;
465     da_FT_Stroker_BeginSubPath FT_Stroker_BeginSubPath;
466     da_FT_Stroker_EndSubPath FT_Stroker_EndSubPath;
467     da_FT_Stroker_LineTo FT_Stroker_LineTo;
468     da_FT_Stroker_ConicTo FT_Stroker_ConicTo;
469     da_FT_Stroker_CubicTo FT_Stroker_CubicTo;
470     da_FT_Stroker_GetBorderCounts FT_Stroker_GetBorderCounts;
471     da_FT_Stroker_ExportBorder FT_Stroker_ExportBorder;
472     da_FT_Stroker_GetCounts FT_Stroker_GetCounts;
473     da_FT_Stroker_Export FT_Stroker_Export;
474     da_FT_Stroker_Done FT_Stroker_Done;
475     da_FT_Glyph_Stroke FT_Glyph_Stroke;
476     da_FT_Glyph_StrokeBorder FT_Glyph_StrokeBorder;
477 
478     da_FT_GlyphSlot_Embolden FT_GlyphSlot_Embolden;
479     da_FT_GlyphSlot_Oblique FT_GlyphSlot_Oblique;
480 
481     da_FT_Sin FT_Sin;
482     da_FT_Cos FT_Cos;
483     da_FT_Tan FT_Tan;
484     da_FT_Atan2 FT_Atan2;
485     da_FT_Angle_Diff FT_Angle_Diff;
486     da_FT_Vector_Unit FT_Vector_Unit;
487     da_FT_Vector_Rotate FT_Vector_Rotate;
488     da_FT_Vector_Length FT_Vector_Length;
489     da_FT_Vector_Polarize FT_Vector_Polarize;
490     da_FT_Vector_From_Polar FT_Vector_From_Polar;
491 
492     da_FT_Get_WinFNT_Header FT_Get_WinFNT_Header;
493 
494     da_FT_Get_X11_Font_Format FT_Get_X11_Font_Format;
495 
496     da_FT_Has_PS_Glyph_Names FT_Has_PS_Glyph_Names;
497     da_FT_Get_PS_Font_Info FT_Get_PS_Font_Info;
498     da_FT_Get_PS_Font_Private FT_Get_PS_Font_Private;
499     da_FT_Get_PS_Font_Value FT_Get_PS_Font_Value;
500 
501     da_FT_Get_Sfnt_Table FT_Get_Sfnt_Table;
502     da_FT_Load_Sfnt_Table FT_Load_Sfnt_Table;
503     da_FT_Sfnt_Table_Info FT_Sfnt_Table_Info;
504     da_FT_Get_CMap_Language_ID FT_Get_CMap_Language_ID;
505     da_FT_Get_CMap_Format FT_Get_CMap_Format;
506 }
507 
508 private
509 {
510     SharedLib lib;
511     FreetypeSupport loadedVersion;
512 }
513 
514 void unloadFreetype()
515 {
516     if (lib != invalidHandle)
517     {
518         lib.unload();
519     }
520 }
521 
522 FreetypeSupport loadedFreetypeVersion() { return loadedVersion; }
523 bool isFreetypeLoaded() { return lib != invalidHandle; }
524 
525 FreetypeSupport loadFreetype()
526 {
527     version(Windows)
528     {
529         const(char)[][3] libNames =
530         [
531             "freetype.dll",
532             "libfreetype.dll",
533             "libfreetype-6.dll"
534         ];
535     }
536     else version(OSX)
537     {
538         const(char)[][7] libNames =
539         [
540             "freetype.dylib",
541             "freetype.6.dylib",
542             "libfreetype.6.3.16.dylib",
543             "/usr/X11/lib/libfreetype.dylib",
544             "/usr/X11/lib/libfreetype.6.dylib",
545             "/usr/X11/lib/libfreetype.6.3.16.dylib",
546             "/opt/X11/lib/libfreetype.dylib"
547         ];
548     }
549     else version(Posix)
550     {
551         const(char)[][2] libNames =
552         [
553             "libfreetype.so.6",
554             "libfreetype.so"
555         ];
556     }
557     else static assert(0, "bindbc-freetype is not yet supported on this platform.");
558 
559     FreetypeSupport ret;
560     foreach(name; libNames)
561     {
562         ret = loadFreetype(name.ptr);
563         if (ret != FreetypeSupport.noLibrary)
564             break;
565     }
566     return ret;
567 }
568 
569 FreetypeSupport loadFreetype(const(char)* libName)
570 {    
571     lib = load(libName);
572     if(lib == invalidHandle)
573     {
574         return FreetypeSupport.noLibrary;
575     }
576 
577     auto errCount = errorCount();
578     loadedVersion = FreetypeSupport.badLibrary;
579 
580     lib.bindSymbol(cast(void**)&FT_Init_FreeType, "FT_Init_FreeType");
581     lib.bindSymbol(cast(void**)&FT_Done_FreeType, "FT_Done_FreeType");
582     lib.bindSymbol(cast(void**)&FT_New_Face, "FT_New_Face");
583     lib.bindSymbol(cast(void**)&FT_New_Memory_Face, "FT_New_Memory_Face");
584     lib.bindSymbol(cast(void**)&FT_Open_Face, "FT_Open_Face");
585     lib.bindSymbol(cast(void**)&FT_Attach_File, "FT_Attach_File");
586     lib.bindSymbol(cast(void**)&FT_Attach_Stream, "FT_Attach_Stream");
587     lib.bindSymbol(cast(void**)&FT_Reference_Face, "FT_Reference_Face");
588     lib.bindSymbol(cast(void**)&FT_Done_Face, "FT_Done_Face");
589     lib.bindSymbol(cast(void**)&FT_Select_Size, "FT_Select_Size");
590     lib.bindSymbol(cast(void**)&FT_Request_Size, "FT_Request_Size");
591     lib.bindSymbol(cast(void**)&FT_Set_Char_Size, "FT_Set_Char_Size");
592     lib.bindSymbol(cast(void**)&FT_Set_Pixel_Sizes, "FT_Set_Pixel_Sizes");
593     lib.bindSymbol(cast(void**)&FT_Load_Glyph, "FT_Load_Glyph");
594     lib.bindSymbol(cast(void**)&FT_Load_Char, "FT_Load_Char");
595     lib.bindSymbol(cast(void**)&FT_Set_Transform, "FT_Set_Transform");
596     lib.bindSymbol(cast(void**)&FT_Render_Glyph, "FT_Render_Glyph");
597     lib.bindSymbol(cast(void**)&FT_Get_Kerning, "FT_Get_Kerning");
598     lib.bindSymbol(cast(void**)&FT_Get_Track_Kerning, "FT_Get_Track_Kerning");
599     lib.bindSymbol(cast(void**)&FT_Get_Glyph_Name, "FT_Get_Glyph_Name");
600     lib.bindSymbol(cast(void**)&FT_Get_Postscript_Name, "FT_Get_Postscript_Name");
601     lib.bindSymbol(cast(void**)&FT_Select_Charmap, "FT_Select_Charmap");
602     lib.bindSymbol(cast(void**)&FT_Set_Charmap, "FT_Set_Charmap");
603     lib.bindSymbol(cast(void**)&FT_Get_Charmap_Index, "FT_Get_Charmap_Index");
604     lib.bindSymbol(cast(void**)&FT_Get_Char_Index, "FT_Get_Char_Index");
605     lib.bindSymbol(cast(void**)&FT_Get_First_Char, "FT_Get_First_Char");
606     lib.bindSymbol(cast(void**)&FT_Get_Next_Char, "FT_Get_Next_Char");
607     lib.bindSymbol(cast(void**)&FT_Get_Name_Index, "FT_Get_Name_Index");
608     lib.bindSymbol(cast(void**)&FT_Get_SubGlyph_Info, "FT_Get_SubGlyph_Info");
609     lib.bindSymbol(cast(void**)&FT_Get_FSType_Flags, "FT_Get_FSType_Flags");
610     lib.bindSymbol(cast(void**)&FT_Face_GetCharVariantIndex, "FT_Face_GetCharVariantIndex");
611     lib.bindSymbol(cast(void**)&FT_Face_GetCharVariantIsDefault, "FT_Face_GetCharVariantIsDefault");
612     lib.bindSymbol(cast(void**)&FT_Face_GetVariantSelectors, "FT_Face_GetVariantSelectors");
613     lib.bindSymbol(cast(void**)&FT_Face_GetVariantsOfChar, "FT_Face_GetVariantsOfChar");
614     lib.bindSymbol(cast(void**)&FT_Face_GetCharsOfVariant, "FT_Face_GetCharsOfVariant");
615     lib.bindSymbol(cast(void**)&FT_MulDiv, "FT_MulDiv");
616     lib.bindSymbol(cast(void**)&FT_MulFix, "FT_MulFix");
617     lib.bindSymbol(cast(void**)&FT_DivFix, "FT_DivFix");
618     lib.bindSymbol(cast(void**)&FT_RoundFix, "FT_RoundFix");
619     lib.bindSymbol(cast(void**)&FT_CeilFix, "FT_CeilFix");
620     lib.bindSymbol(cast(void**)&FT_FloorFix, "FT_FloorFix");
621     lib.bindSymbol(cast(void**)&FT_Vector_Transform, "FT_Vector_Transform");
622     lib.bindSymbol(cast(void**)&FT_Library_Version, "FT_Library_Version");
623     lib.bindSymbol(cast(void**)&FT_Face_CheckTrueTypePatents, "FT_Face_CheckTrueTypePatents");
624     lib.bindSymbol(cast(void**)&FT_Face_SetUnpatentedHinting, "FT_Face_SetUnpatentedHinting");
625 
626     lib.bindSymbol(cast(void**)&FT_Get_Advance, "FT_Get_Advance");
627     lib.bindSymbol(cast(void**)&FT_Get_Advances, "FT_Get_Advances");
628 
629     lib.bindSymbol(cast(void**)&FT_Outline_Get_BBox, "FT_Outline_Get_BBox");
630 
631     version(linux) {
632         lib.bindSymbol(cast(void**)&FT_Get_BDF_Charset_ID, "FT_Get_BDF_Charset_ID");
633         lib.bindSymbol(cast(void**)&FT_Get_BDF_Property, "FT_Get_BDF_Property");
634     }
635 
636     lib.bindSymbol(cast(void**)&FT_Bitmap_Init, "FT_Bitmap_Init");
637     lib.bindSymbol(cast(void**)&FT_Bitmap_Copy, "FT_Bitmap_Copy");
638     lib.bindSymbol(cast(void**)&FT_Bitmap_Embolden, "FT_Bitmap_Embolden");
639     lib.bindSymbol(cast(void**)&FT_Bitmap_Convert, "FT_Bitmap_Convert");
640     lib.bindSymbol(cast(void**)&FT_Bitmap_Done, "FT_Bitmap_Done");
641     lib.bindSymbol(cast(void**)&FT_GlyphSlot_Own_Bitmap, "FT_GlyphSlot_Own_Bitmap");
642 
643     lib.bindSymbol(cast(void**)&FT_Stream_OpenBzip2, "FT_Stream_OpenBzip2");
644 
645     lib.bindSymbol(cast(void**)&FTC_Manager_New, "FTC_Manager_New");
646     lib.bindSymbol(cast(void**)&FTC_Manager_Reset, "FTC_Manager_Reset");
647     lib.bindSymbol(cast(void**)&FTC_Manager_Done, "FTC_Manager_Done");
648     lib.bindSymbol(cast(void**)&FTC_Manager_LookupFace, "FTC_Manager_LookupFace");
649     lib.bindSymbol(cast(void**)&FTC_Manager_LookupSize, "FTC_Manager_LookupSize");
650     lib.bindSymbol(cast(void**)&FTC_Node_Unref, "FTC_Node_Unref");
651     lib.bindSymbol(cast(void**)&FTC_Manager_RemoveFaceID, "FTC_Manager_RemoveFaceID");
652     lib.bindSymbol(cast(void**)&FTC_CMapCache_New, "FTC_CMapCache_New");
653     lib.bindSymbol(cast(void**)&FTC_CMapCache_Lookup, "FTC_CMapCache_Lookup");
654     lib.bindSymbol(cast(void**)&FTC_ImageCache_New, "FTC_ImageCache_New");
655     lib.bindSymbol(cast(void**)&FTC_ImageCache_Lookup, "FTC_ImageCache_Lookup");
656     lib.bindSymbol(cast(void**)&FTC_ImageCache_LookupScaler, "FTC_ImageCache_LookupScaler");
657     lib.bindSymbol(cast(void**)&FTC_SBitCache_New, "FTC_SBitCache_New");
658     lib.bindSymbol(cast(void**)&FTC_SBitCache_Lookup, "FTC_SBitCache_Lookup");
659     lib.bindSymbol(cast(void**)&FTC_SBitCache_LookupScaler, "FTC_SBitCache_LookupScaler");
660 
661     lib.bindSymbol(cast(void**)&FT_Get_CID_Registry_Ordering_Supplement, "FT_Get_CID_Registry_Ordering_Supplement");
662     lib.bindSymbol(cast(void**)&FT_Get_CID_Is_Internally_CID_Keyed, "FT_Get_CID_Is_Internally_CID_Keyed");
663     lib.bindSymbol(cast(void**)&FT_Get_CID_From_Glyph_Index, "FT_Get_CID_From_Glyph_Index");
664 
665     lib.bindSymbol(cast(void**)&FT_Get_Gasp, "FT_Get_Gasp");
666 
667     lib.bindSymbol(cast(void**)&FT_Get_Glyph, "FT_Get_Glyph");
668     lib.bindSymbol(cast(void**)&FT_Glyph_Copy, "FT_Glyph_Copy");
669     lib.bindSymbol(cast(void**)&FT_Glyph_Transform, "FT_Glyph_Transform");
670     lib.bindSymbol(cast(void**)&FT_Glyph_Get_CBox, "FT_Glyph_Get_CBox");
671     lib.bindSymbol(cast(void**)&FT_Glyph_To_Bitmap, "FT_Glyph_To_Bitmap");
672     lib.bindSymbol(cast(void**)&FT_Done_Glyph, "FT_Done_Glyph");
673     lib.bindSymbol(cast(void**)&FT_Matrix_Multiply, "FT_Matrix_Multiply");
674     lib.bindSymbol(cast(void**)&FT_Matrix_Invert, "FT_Matrix_Invert");
675 
676     lib.bindSymbol(cast(void**)&FT_TrueTypeGX_Validate, "FT_TrueTypeGX_Validate");
677     lib.bindSymbol(cast(void**)&FT_TrueTypeGX_Free, "FT_TrueTypeGX_Free");
678     lib.bindSymbol(cast(void**)&FT_ClassicKern_Validate, "FT_ClassicKern_Validate");
679     lib.bindSymbol(cast(void**)&FT_ClassicKern_Free, "FT_ClassicKern_Free");
680 
681     lib.bindSymbol(cast(void**)&FT_Stream_OpenGzip, "FT_Stream_OpenGzip");
682     lib.bindSymbol(cast(void**)&FT_Gzip_Uncompress, "FT_Gzip_Uncompress");
683 
684     lib.bindSymbol(cast(void**)&FT_Library_SetLcdFilter, "FT_Library_SetLcdFilter");
685     lib.bindSymbol(cast(void**)&FT_Library_SetLcdFilterWeights, "FT_Library_SetLcdFilterWeights");
686 
687     lib.bindSymbol(cast(void**)&FT_List_Find, "FT_List_Find");
688     lib.bindSymbol(cast(void**)&FT_List_Add, "FT_List_Add");
689     lib.bindSymbol(cast(void**)&FT_List_Insert, "FT_List_Insert");
690     lib.bindSymbol(cast(void**)&FT_List_Remove, "FT_List_Remove");
691     lib.bindSymbol(cast(void**)&FT_List_Up, "FT_List_Up");
692     lib.bindSymbol(cast(void**)&FT_List_Iterate, "FT_List_Iterate");
693     lib.bindSymbol(cast(void**)&FT_List_Finalize, "FT_List_Finalize");
694 
695     lib.bindSymbol(cast(void**)&FT_Stream_OpenLZW, "FT_Stream_OpenLZW");
696 
697     lib.bindSymbol(cast(void**)&FT_Get_Multi_Master, "FT_Get_Multi_Master");
698     lib.bindSymbol(cast(void**)&FT_Get_MM_Var, "FT_Get_MM_Var");
699     lib.bindSymbol(cast(void**)&FT_Set_MM_Design_Coordinates, "FT_Set_MM_Design_Coordinates");
700     lib.bindSymbol(cast(void**)&FT_Set_Var_Design_Coordinates, "FT_Set_Var_Design_Coordinates");
701     lib.bindSymbol(cast(void**)&FT_Set_MM_Blend_Coordinates, "FT_Set_MM_Blend_Coordinates");
702     lib.bindSymbol(cast(void**)&FT_Set_Var_Blend_Coordinates, "FT_Set_Var_Blend_Coordinates");
703 
704     lib.bindSymbol(cast(void**)&FT_Add_Module, "FT_Add_Module");
705     lib.bindSymbol(cast(void**)&FT_Get_Module, "FT_Get_Module");
706     lib.bindSymbol(cast(void**)&FT_Remove_Module, "FT_Remove_Module");
707     lib.bindSymbol(cast(void**)&FT_Property_Set, "FT_Property_Set");
708     lib.bindSymbol(cast(void**)&FT_Property_Get, "FT_Property_Get");
709     lib.bindSymbol(cast(void**)&FT_Reference_Library, "FT_Reference_Library");
710     lib.bindSymbol(cast(void**)&FT_New_Library, "FT_New_Library");
711     lib.bindSymbol(cast(void**)&FT_Done_Library, "FT_Done_Library");
712     lib.bindSymbol(cast(void**)&FT_Set_Debug_Hook, "FT_Set_Debug_Hook");
713     lib.bindSymbol(cast(void**)&FT_Add_Default_Modules, "FT_Add_Default_Modules");
714     lib.bindSymbol(cast(void**)&FT_Get_TrueType_Engine_Type, "FT_Get_TrueType_Engine_Type");
715 
716     lib.bindSymbol(cast(void**)&FT_OpenType_Validate, "FT_OpenType_Validate");
717     lib.bindSymbol(cast(void**)&FT_OpenType_Free, "FT_OpenType_Free");
718 
719     lib.bindSymbol(cast(void**)&FT_Outline_Decompose, "FT_Outline_Decompose");
720     lib.bindSymbol(cast(void**)&FT_Outline_New, "FT_Outline_New");
721     lib.bindSymbol(cast(void**)&FT_Outline_New_Internal, "FT_Outline_New_Internal");
722     lib.bindSymbol(cast(void**)&FT_Outline_Done, "FT_Outline_Done");
723     lib.bindSymbol(cast(void**)&FT_Outline_Done_Internal, "FT_Outline_Done_Internal");
724     lib.bindSymbol(cast(void**)&FT_Outline_Check, "FT_Outline_Check");
725     lib.bindSymbol(cast(void**)&FT_Outline_Get_CBox, "FT_Outline_Get_CBox");
726     lib.bindSymbol(cast(void**)&FT_Outline_Translate, "FT_Outline_Translate");
727     lib.bindSymbol(cast(void**)&FT_Outline_Copy, "FT_Outline_Copy");
728     lib.bindSymbol(cast(void**)&FT_Outline_Transform, "FT_Outline_Transform");
729     lib.bindSymbol(cast(void**)&FT_Outline_Embolden, "FT_Outline_Embolden");
730     lib.bindSymbol(cast(void**)&FT_Outline_EmboldenXY, "FT_Outline_EmboldenXY");
731     lib.bindSymbol(cast(void**)&FT_Outline_Reverse, "FT_Outline_Reverse");
732     lib.bindSymbol(cast(void**)&FT_Outline_Get_Bitmap, "FT_Outline_Get_Bitmap");
733     lib.bindSymbol(cast(void**)&FT_Outline_Render, "FT_Outline_Render");
734     lib.bindSymbol(cast(void**)&FT_Outline_Get_Orientation, "FT_Outline_Get_Orientation");
735 
736     lib.bindSymbol(cast(void**)&FT_Get_PFR_Metrics, "FT_Get_PFR_Metrics");
737     lib.bindSymbol(cast(void**)&FT_Get_PFR_Kerning, "FT_Get_PFR_Kerning");
738     lib.bindSymbol(cast(void**)&FT_Get_PFR_Advance, "FT_Get_PFR_Advance");
739 
740     lib.bindSymbol(cast(void**)&FT_Get_Renderer, "FT_Get_Renderer");
741     lib.bindSymbol(cast(void**)&FT_Set_Renderer, "FT_Set_Renderer");
742 
743     lib.bindSymbol(cast(void**)&FT_New_Size, "FT_New_Size");
744     lib.bindSymbol(cast(void**)&FT_Done_Size, "FT_Done_Size");
745     lib.bindSymbol(cast(void**)&FT_Activate_Size, "FT_Activate_Size");
746 
747     lib.bindSymbol(cast(void**)&FT_Get_Sfnt_Name_Count, "FT_Get_Sfnt_Name_Count");
748     lib.bindSymbol(cast(void**)&FT_Get_Sfnt_Name, "FT_Get_Sfnt_Name");
749 
750     lib.bindSymbol(cast(void**)&FT_Outline_GetInsideBorder, "FT_Outline_GetInsideBorder");
751     lib.bindSymbol(cast(void**)&FT_Outline_GetOutsideBorder, "FT_Outline_GetOutsideBorder");
752     lib.bindSymbol(cast(void**)&FT_Stroker_New, "FT_Stroker_New");
753     lib.bindSymbol(cast(void**)&FT_Stroker_Set, "FT_Stroker_Set");
754     lib.bindSymbol(cast(void**)&FT_Stroker_Rewind, "FT_Stroker_Rewind");
755     lib.bindSymbol(cast(void**)&FT_Stroker_ParseOutline, "FT_Stroker_ParseOutline");
756     lib.bindSymbol(cast(void**)&FT_Stroker_BeginSubPath, "FT_Stroker_BeginSubPath");
757     lib.bindSymbol(cast(void**)&FT_Stroker_EndSubPath, "FT_Stroker_EndSubPath");
758     lib.bindSymbol(cast(void**)&FT_Stroker_LineTo, "FT_Stroker_LineTo");
759     lib.bindSymbol(cast(void**)&FT_Stroker_ConicTo, "FT_Stroker_ConicTo");
760     lib.bindSymbol(cast(void**)&FT_Stroker_CubicTo, "FT_Stroker_CubicTo");
761     lib.bindSymbol(cast(void**)&FT_Stroker_GetBorderCounts, "FT_Stroker_GetBorderCounts");
762     lib.bindSymbol(cast(void**)&FT_Stroker_ExportBorder, "FT_Stroker_ExportBorder");
763     lib.bindSymbol(cast(void**)&FT_Stroker_GetCounts, "FT_Stroker_GetCounts");
764     lib.bindSymbol(cast(void**)&FT_Stroker_Export, "FT_Stroker_Export");
765     lib.bindSymbol(cast(void**)&FT_Stroker_Done, "FT_Stroker_Done");
766     lib.bindSymbol(cast(void**)&FT_Glyph_Stroke, "FT_Glyph_Stroke");
767     lib.bindSymbol(cast(void**)&FT_Glyph_StrokeBorder, "FT_Glyph_StrokeBorder");
768 
769     lib.bindSymbol(cast(void**)&FT_GlyphSlot_Embolden, "FT_GlyphSlot_Embolden");
770     lib.bindSymbol(cast(void**)&FT_GlyphSlot_Oblique, "FT_GlyphSlot_Oblique");
771 
772     lib.bindSymbol(cast(void**)&FT_Sin, "FT_Sin");
773     lib.bindSymbol(cast(void**)&FT_Cos, "FT_Cos");
774     lib.bindSymbol(cast(void**)&FT_Tan, "FT_Tan");
775     lib.bindSymbol(cast(void**)&FT_Atan2, "FT_Atan2");
776     lib.bindSymbol(cast(void**)&FT_Angle_Diff, "FT_Angle_Diff");
777     lib.bindSymbol(cast(void**)&FT_Vector_Unit, "FT_Vector_Unit");
778     lib.bindSymbol(cast(void**)&FT_Vector_Rotate, "FT_Vector_Rotate");
779     lib.bindSymbol(cast(void**)&FT_Vector_Length, "FT_Vector_Length");
780     lib.bindSymbol(cast(void**)&FT_Vector_Polarize, "FT_Vector_Polarize");
781     lib.bindSymbol(cast(void**)&FT_Vector_From_Polar, "FT_Vector_From_Polar");
782 
783     lib.bindSymbol(cast(void**)&FT_Get_WinFNT_Header, "FT_Get_WinFNT_Header");
784 
785     lib.bindSymbol(cast(void**)&FT_Get_X11_Font_Format, "FT_Get_X11_Font_Format");
786 
787     lib.bindSymbol(cast(void**)&FT_Has_PS_Glyph_Names, "FT_Has_PS_Glyph_Names");
788     lib.bindSymbol(cast(void**)&FT_Get_PS_Font_Info, "FT_Get_PS_Font_Info");
789     lib.bindSymbol(cast(void**)&FT_Get_PS_Font_Private, "FT_Get_PS_Font_Private");
790     lib.bindSymbol(cast(void**)&FT_Get_PS_Font_Value, "FT_Get_PS_Font_Value");
791 
792     lib.bindSymbol(cast(void**)&FT_Get_Sfnt_Table, "FT_Get_Sfnt_Table");
793     lib.bindSymbol(cast(void**)&FT_Load_Sfnt_Table, "FT_Load_Sfnt_Table");
794     lib.bindSymbol(cast(void**)&FT_Sfnt_Table_Info, "FT_Sfnt_Table_Info");
795     lib.bindSymbol(cast(void**)&FT_Get_CMap_Language_ID, "FT_Get_CMap_Language_ID");
796     lib.bindSymbol(cast(void**)&FT_Get_CMap_Format, "FT_Get_CMap_Format");
797     
798     loadedVersion = FreetypeSupport.freetype28;
799 
800     if (errorCount() != errCount)
801         return FreetypeSupport.badLibrary;
802 
803     return loadedVersion;
804 }