Ticket #19: ftfuncs.d

File ftfuncs.d, 50.1 kB (added by Cyborg16, 5 months ago)

FT_MAKE_TAG moved to fttypes.d

Line 
1 /*
2  * Copyright (c) 2006 Derelict Developers
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  *   notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  *   notice, this list of conditions and the following disclaimer in the
14  *   documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the names 'Derelict', 'DerelictFT', nor the names of its contributors
17  *   may be used to endorse or promote products derived from this software
18  *   without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /** This module is a collection of all functions defined in the freetype 2 header files, plus
33  * library loading/binding code, as of version 2.3.5.
34  *
35  * Comments show which files the definitions are from; brackets show which C macros include the
36  * file (excluding the inclusion of freetype.h in most files).
37  */
38 module derelict.freetype.ftfuncs;
39
40 private
41 {
42     import derelict.freetype.fttypes;
43     import derelict.util.loader;
44 }
45
46 package void loadFT(SharedLib lib)
47 {
48     // freetype.h (FT_FREETYPE_H)
49     bindFunc(FT_Init_FreeType)("FT_Init_FreeType", lib);
50     bindFunc(FT_Done_FreeType)("FT_Done_FreeType", lib);
51     bindFunc(FT_New_Face)("FT_New_Face", lib);
52     bindFunc(FT_New_Memory_Face)("FT_New_Memory_Face", lib);
53     bindFunc(FT_Open_Face)("FT_Open_Face", lib);
54     bindFunc(FT_Attach_File)("FT_Attach_File", lib);
55     bindFunc(FT_Attach_Stream)("FT_Attach_Stream", lib);
56     bindFunc(FT_Done_Face)("FT_Done_Face", lib);
57     bindFunc(FT_Select_Size)("FT_Select_Size", lib);
58     bindFunc(FT_Request_Size)("FT_Request_Size", lib);
59     bindFunc(FT_Set_Char_Size)("FT_Set_Char_Size", lib);
60     bindFunc(FT_Set_Pixel_Sizes)("FT_Set_Pixel_Sizes", lib);
61     bindFunc(FT_Load_Glyph)("FT_Load_Glyph", lib);
62     bindFunc(FT_Load_Char)("FT_Load_Char", lib);
63     bindFunc(FT_Set_Transform)("FT_Set_Transform", lib);
64     bindFunc(FT_Render_Glyph)("FT_Render_Glyph", lib);
65     bindFunc(FT_Get_Kerning)("FT_Get_Kerning", lib);
66     bindFunc(FT_Get_Track_Kerning)("FT_Get_Track_Kerning", lib);
67     bindFunc(FT_Get_Glyph_Name)("FT_Get_Glyph_Name", lib);
68     bindFunc(FT_Get_Postscript_Name)("FT_Get_Postscript_Name", lib);
69     bindFunc(FT_Select_Charmap)("FT_Select_Charmap", lib);
70     bindFunc(FT_Set_Charmap)("FT_Set_Charmap", lib);
71     bindFunc(FT_Get_Charmap_Index)("FT_Get_Charmap_Index", lib);
72     bindFunc(FT_Get_Char_Index)("FT_Get_Char_Index", lib);
73     bindFunc(FT_Get_First_Char)("FT_Get_First_Char", lib);
74     bindFunc(FT_Get_Next_Char)("FT_Get_Next_Char", lib);
75     bindFunc(FT_Get_Name_Index)("FT_Get_Name_Index", lib);
76     bindFunc(FT_MulDiv)("FT_MulDiv", lib);
77     bindFunc(FT_MulFix)("FT_MulFix", lib);
78     bindFunc(FT_DivFix)("FT_DivFix", lib);
79     bindFunc(FT_RoundFix)("FT_RoundFix", lib);
80     bindFunc(FT_CeilFix)("FT_CeilFix", lib);
81     bindFunc(FT_FloorFix)("FT_FloorFix", lib);
82     bindFunc(FT_Vector_Transform)("FT_Vector_Transform", lib);
83     bindFunc(FT_Library_Version)("FT_Library_Version", lib);
84     bindFunc(FT_Face_CheckTrueTypePatents)("FT_Face_CheckTrueTypePatents", lib);
85     bindFunc(FT_Face_SetUnpatentedHinting)("FT_Face_SetUnpatentedHinting", lib);
86    
87     // ftlist.h (FT_LIST_H)
88     bindFunc(FT_List_Find)("FT_List_Find", lib);
89     bindFunc(FT_List_Add)("FT_List_Add", lib);
90     bindFunc(FT_List_Insert)("FT_List_Insert", lib);
91     bindFunc(FT_List_Remove)("FT_List_Remove", lib);
92     bindFunc(FT_List_Up)("FT_List_Up", lib);
93     bindFunc(FT_List_Iterate)("FT_List_Iterate", lib);
94     bindFunc(FT_List_Finalize)("FT_List_Finalize", lib);
95    
96     // ftoutln (FT_OUTLINE_H, FT_STROKER_H)
97     bindFunc(FT_Outline_Decompose)("FT_Outline_Decompose", lib);
98     bindFunc(FT_Outline_New)("FT_Outline_New", lib);
99     bindFunc(FT_Outline_New_Internal)("FT_Outline_New_Internal", lib);
100     bindFunc(FT_Outline_Done)("FT_Outline_Done", lib);
101     bindFunc(FT_Outline_Done_Internal)("FT_Outline_Done_Internal", lib);
102     bindFunc(FT_Outline_Check)("FT_Outline_Check", lib);
103     bindFunc(FT_Outline_Get_CBox)("FT_Outline_Get_CBox", lib);
104     bindFunc(FT_Outline_Translate)("FT_Outline_Translate", lib);
105     bindFunc(FT_Outline_Copy)("FT_Outline_Copy", lib);
106     bindFunc(FT_Outline_Transform)("FT_Outline_Transform", lib);
107     bindFunc(FT_Outline_Embolden)("FT_Outline_Embolden", lib);
108     bindFunc(FT_Outline_Reverse)("FT_Outline_Reverse", lib);
109     bindFunc(FT_Outline_Get_Bitmap)("FT_Outline_Get_Bitmap", lib);
110     bindFunc(FT_Outline_Render)("FT_Outline_Render", lib);
111     bindFunc(FT_Outline_Get_Orientation)("FT_Outline_Get_Orientation", lib);
112    
113     // ftsizes.h (FT_SIZES_H)
114     bindFunc(FT_New_Size)("FT_New_Size", lib);
115     bindFunc(FT_Done_Size)("FT_Done_Size", lib);
116     bindFunc(FT_Activate_Size)("FT_Activate_Size", lib);
117    
118     // ftmodapi.h (FT_MODULE_H, FT_RENDER_H)
119     bindFunc(FT_Add_Module)("FT_Add_Module", lib);
120     bindFunc(FT_Get_Module)("FT_Get_Module", lib);
121     bindFunc(FT_Remove_Module)("FT_Remove_Module", lib);
122     bindFunc(FT_New_Library)("FT_New_Library", lib);
123     bindFunc(FT_Done_Library)("FT_Done_Library", lib);
124     bindFunc(FT_Set_Debug_Hook)("FT_Set_Debug_Hook", lib);
125     bindFunc(FT_Add_Default_Modules)("FT_Add_Default_Modules", lib);
126     bindFunc(FT_Get_TrueType_Engine_Type)("FT_Get_TrueType_Engine_Type", lib);
127    
128     // ftrender.h (FT_RENDER_H)
129     bindFunc(FT_Get_Renderer)("FT_Get_Renderer", lib);
130     bindFunc(FT_Set_Renderer)("FT_Set_Renderer", lib);
131    
132     // t1tables.h (FT_TYPE1_TABLES_H)
133     bindFunc(FT_Has_PS_Glyph_Names)("FT_Has_PS_Glyph_Names", lib);
134     bindFunc(FT_Get_PS_Font_Info)("FT_Get_PS_Font_Info", lib);
135     bindFunc(FT_Get_PS_Font_Private)("FT_Get_PS_Font_Private", lib);
136    
137     // tttables.h (FT_TRUETYPE_TABLES_H)
138     bindFunc(FT_Get_Sfnt_Table)("FT_Get_Sfnt_Table", lib);
139     bindFunc(FT_Load_Sfnt_Table)("FT_Load_Sfnt_Table", lib);
140     bindFunc(FT_Sfnt_Table_Info)("FT_Sfnt_Table_Info", lib);
141     bindFunc(FT_Get_CMap_Language_ID)("FT_Get_CMap_Language_ID", lib);
142     bindFunc(FT_Get_CMap_Format)("FT_Get_CMap_Format", lib);
143    
144     // ftbdf.h (FT_BDF_H)
145     bindFunc(FT_Get_BDF_Charset_ID)("FT_Get_BDF_Charset_ID", lib);
146     bindFunc(FT_Get_BDF_Property)("FT_Get_BDF_Property", lib);
147    
148     // ftgzip.h (FT_GZIP_H)
149     bindFunc(FT_Stream_OpenGzip)("FT_Stream_OpenGzip", lib);
150    
151     // ftlzw.h (FT_LZW_H)
152     bindFunc(FT_Stream_OpenLZW)("FT_Stream_OpenLZW", lib);
153    
154     // ftwinfnt.h (FT_WINFONTS_H)
155     bindFunc(FT_Get_WinFNT_Header)("FT_Get_WinFNT_Header", lib);
156    
157     // ftglyph.h (FT_GLYPH_H, FT_CACHE_H, FT_STROKER_H)
158     bindFunc(FT_Get_Glyph)("FT_Get_Glyph", lib);
159     bindFunc(FT_Glyph_Copy)("FT_Glyph_Copy", lib);
160     bindFunc(FT_Glyph_Transform)("FT_Glyph_Transform", lib);
161     bindFunc(FT_Glyph_Get_CBox)("FT_Glyph_Get_CBox", lib);
162     bindFunc(FT_Glyph_To_Bitmap)("FT_Glyph_To_Bitmap", lib);
163     bindFunc(FT_Done_Glyph)("FT_Done_Glyph", lib);
164     bindFunc(FT_Matrix_Multiply)("FT_Matrix_Multiply", lib);
165     bindFunc(FT_Matrix_Invert)("FT_Matrix_Invert", lib);
166    
167     // ftbitmap.h (FT_BITMAP_H)
168     bindFunc(FT_Bitmap_New)("FT_Bitmap_New", lib);
169     bindFunc(FT_Bitmap_Copy)("FT_Bitmap_Copy", lib);
170     bindFunc(FT_Bitmap_Embolden)("FT_Bitmap_Embolden", lib);
171     bindFunc(FT_Bitmap_Convert)("FT_Bitmap_Convert", lib);
172     bindFunc(FT_Bitmap_Done)("FT_Bitmap_Done", lib);
173    
174     // ftbbox.h (FT_BBOX_H)
175     bindFunc(FT_Outline_Get_BBox)("FT_Outline_Get_BBox", lib);
176    
177     // ftcache.h (FT_CACHE_H)
178     bindFunc(FTC_Manager_New)("FTC_Manager_New", lib);
179     bindFunc(FTC_Manager_Reset)("FTC_Manager_Reset", lib);
180     bindFunc(FTC_Manager_Done)("FTC_Manager_Done", lib);
181     bindFunc(FTC_Manager_LookupFace)("FTC_Manager_LookupFace", lib);
182     bindFunc(FTC_Manager_LookupSize)("FTC_Manager_LookupSize", lib);
183     bindFunc(FTC_Node_Unref)("FTC_Node_Unref", lib);
184     bindFunc(FTC_Manager_RemoveFaceID)("FTC_Manager_RemoveFaceID", lib);
185     bindFunc(FTC_CMapCache_New)("FTC_CMapCache_New", lib);
186     bindFunc(FTC_CMapCache_Lookup)("FTC_CMapCache_Lookup", lib);
187     bindFunc(FTC_ImageCache_New)("FTC_ImageCache_New", lib);
188     bindFunc(FTC_ImageCache_Lookup)("FTC_ImageCache_Lookup", lib);
189     bindFunc(FTC_ImageCache_LookupScaler)("FTC_ImageCache_LookupScaler", lib);
190     bindFunc(FTC_SBitCache_New)("FTC_SBitCache_New", lib);
191     bindFunc(FTC_SBitCache_Lookup)("FTC_SBitCache_Lookup", lib);
192     bindFunc(FTC_SBitCache_LookupScaler)("FTC_SBitCache_LookupScaler", lib);
193    
194     // ftmm.h (FT_MULTIPLE_MASTERS_H)
195     bindFunc(FT_Get_Multi_Master)("FT_Get_Multi_Master", lib);
196     bindFunc(FT_Get_MM_Var)("FT_Get_MM_Var", lib);
197     bindFunc(FT_Set_MM_Design_Coordinates)("FT_Set_MM_Design_Coordinates", lib);
198     bindFunc(FT_Set_Var_Design_Coordinates)("FT_Set_Var_Design_Coordinates", lib);
199     bindFunc(FT_Set_MM_Blend_Coordinates)("FT_Set_MM_Blend_Coordinates", lib);
200     bindFunc(FT_Set_Var_Blend_Coordinates)("FT_Set_Var_Blend_Coordinates", lib);
201    
202     // ftsnames.h (FT_SFNT_NAMES_H)
203     bindFunc(FT_Get_Sfnt_Name_Count)("FT_Get_Sfnt_Name_Count", lib);
204     bindFunc(FT_Get_Sfnt_Name)("FT_Get_Sfnt_Name", lib);
205    
206     // ftotval.h (FT_OPENTYPE_VALIDATE_H)
207     bindFunc(FT_OpenType_Validate)("FT_OpenType_Validate", lib);
208     bindFunc(FT_OpenType_Free)("FT_OpenType_Free", lib);
209    
210     // ftgxval.h (FT_GX_VALIDATE_H)
211     bindFunc(FT_TrueTypeGX_Validate)("FT_TrueTypeGX_Validate", lib);
212     bindFunc(FT_TrueTypeGX_Free)("FT_TrueTypeGX_Free", lib);
213     bindFunc(FT_ClassicKern_Validate)("FT_ClassicKern_Validate", lib);
214     bindFunc(FT_ClassicKern_Free)("FT_ClassicKern_Free", lib);
215    
216     // ftpfr (FT_PFR_H)
217     bindFunc(FT_Get_PFR_Metrics)("FT_Get_PFR_Metrics", lib);
218     bindFunc(FT_Get_PFR_Kerning)("FT_Get_PFR_Kerning", lib);
219     bindFunc(FT_Get_PFR_Advance)("FT_Get_PFR_Advance", lib);
220
221     // ftstroke.h (FT_STROKER_H)
222     bindFunc(FT_Outline_GetInsideBorder)("FT_Outline_GetInsideBorder", lib);
223     bindFunc(FT_Outline_GetOutsideBorder)("FT_Outline_GetOutsideBorder", lib);
224     bindFunc(FT_Stroker_New)("FT_Stroker_New", lib);
225     bindFunc(FT_Stroker_Set)("FT_Stroker_Set", lib);
226     bindFunc(FT_Stroker_Rewind)("FT_Stroker_Rewind", lib);
227     bindFunc(FT_Stroker_ParseOutline)("FT_Stroker_ParseOutline", lib);
228     bindFunc(FT_Stroker_BeginSubPath)("FT_Stroker_BeginSubPath", lib);
229     bindFunc(FT_Stroker_EndSubPath)("FT_Stroker_EndSubPath", lib);
230     bindFunc(FT_Stroker_LineTo)("FT_Stroker_LineTo", lib);
231     bindFunc(FT_Stroker_ConicTo)("FT_Stroker_ConicTo", lib);
232     bindFunc(FT_Stroker_CubicTo)("FT_Stroker_CubicTo", lib);
233     bindFunc(FT_Stroker_GetBorderCounts)("FT_Stroker_GetBorderCounts", lib);
234     bindFunc(FT_Stroker_ExportBorder)("FT_Stroker_ExportBorder", lib);
235     bindFunc(FT_Stroker_GetCounts)("FT_Stroker_GetCounts", lib);
236     bindFunc(FT_Stroker_Export)("FT_Stroker_Export", lib);
237     bindFunc(FT_Stroker_Done)("FT_Stroker_Done", lib);
238     bindFunc(FT_Glyph_Stroke)("FT_Glyph_Stroke", lib);
239     bindFunc(FT_Glyph_StrokeBorder)("FT_Glyph_StrokeBorder", lib);
240    
241     // ftsynth.h (FT_SYNTHESIS_H) (WARNING: ALPHA CODE)
242     bindFunc(FT_GlyphSlot_Own_Bitmap)("FT_GlyphSlot_Own_Bitmap", lib);
243     bindFunc(FT_GlyphSlot_Embolden)("FT_GlyphSlot_Embolden", lib);
244     bindFunc(FT_GlyphSlot_Oblique)("FT_GlyphSlot_Oblique", lib);
245    
246     // ftxf86.h (FT_XFREE86_H)
247     bindFunc(FT_Get_X11_Font_Format)("FT_Get_X11_Font_Format", lib);
248    
249     // fttrigon.h (FT_TRIGONOMETRY_H)
250     bindFunc(FT_Sin)("FT_Sin", lib);
251     bindFunc(FT_Cos)("FT_Cos", lib);
252     bindFunc(FT_Tan)("FT_Tan", lib);
253     bindFunc(FT_Atan2)("FT_Atan2", lib);
254     bindFunc(FT_Angle_Diff)("FT_Angle_Diff", lib);
255     bindFunc(FT_Vector_Unit)("FT_Vector_Unit", lib);
256     bindFunc(FT_Vector_Rotate)("FT_Vector_Rotate", lib);
257     bindFunc(FT_Vector_Length)("FT_Vector_Length", lib);
258     bindFunc(FT_Vector_Polarize)("FT_Vector_Polarize", lib);
259     bindFunc(FT_Vector_From_Polar)("FT_Vector_From_Polar", lib);
260    
261     // ftlcdfil.h (FT_LCD_FILTER_H)
262     bindFunc(FT_Library_SetLcdFilter)("FT_Library_SetLcdFilter", lib);
263    
264     // ftgasp.h (FT_GASP_H)
265     bindFunc(FT_Get_Gasp)("FT_Get_Gasp", lib);
266    
267     /+ other
268     //bindFunc(ftc_node_destroy)("ftc_node_destroy", lib);
269     bindFunc(FT_Alloc)("FT_Alloc", lib);
270     bindFunc(FT_QAlloc)("FT_QAlloc", lib);
271     bindFunc(FT_Realloc)("FT_Realloc", lib);
272     bindFunc(FT_QRealloc)("FT_QRealloc", lib);
273     bindFunc(FT_Free)("FT_Free", lib);
274     bindFunc(FT_GlyphLoader_New)("FT_GlyphLoader_New", lib);
275     bindFunc(FT_GlyphLoader_CreateExtra)("FT_GlyphLoader_CreateExtra", lib);
276     bindFunc(FT_GlyphLoader_Done)("FT_GlyphLoader_Done", lib);
277     bindFunc(FT_GlyphLoader_Reset)("FT_GlyphLoader_Reset", lib);
278     bindFunc(FT_GlyphLoader_Rewind)("FT_GlyphLoader_Rewind", lib);
279     bindFunc(FT_GlyphLoader_CheckPoints)("FT_GlyphLoader_CheckPoints", lib);
280     bindFunc(FT_GlyphLoader_CheckSubGlyphs)("FT_GlyphLoader_CheckSubGlyphs", lib);
281     bindFunc(FT_GlyphLoader_Prepare)("FT_GlyphLoader_Prepare", lib);
282     bindFunc(FT_GlyphLoader_Add)("FT_GlyphLoader_Add", lib);
283     bindFunc(FT_GlyphLoader_CopyPoints)("FT_GlyphLoader_CopyPoints", lib);
284     bindFunc(ft_service_list_lookup)("ft_service_list_lookup", lib);
285     bindFunc(FT_CMap_New)("FT_CMap_New", lib);
286     bindFunc(FT_CMap_Done)("FT_CMap_Done", lib);
287     bindFunc(FT_Get_Module_Interface)("FT_Get_Module_Interface", lib);
288     bindFunc(ft_module_get_service)("ft_module_get_service", lib);
289     bindFunc(FT_New_GlyphSlot)("FT_New_GlyphSlot", lib);
290     bindFunc(FT_Done_GlyphSlot)("FT_Done_GlyphSlot", lib);
291     bindFunc(ft_glyphslot_free_bitmap)("ft_glyphslot_free_bitmap", lib);
292     bindFunc(ft_glyphslot_alloc_bitmap)("ft_glyphslot_alloc_bitmap", lib);
293     bindFunc(ft_glyphslot_set_bitmap)("ft_glyphslot_set_bitmap", lib);
294     bindFunc(FT_Lookup_Renderer)("FT_Lookup_Renderer", lib);
295     bindFunc(FT_Render_Glyph_Internal)("FT_Render_Glyph_Internal", lib);
296     bindFunc(FT_New_Memory)("FT_New_Memory", lib);
297     bindFunc(FT_Done_Memory)("FT_Done_Memory", lib);
298     bindFunc(FT_Stream_Open)("FT_Stream_Open", lib);
299     bindFunc(FT_Stream_New)("FT_Stream_New", lib);
300     bindFunc(FT_Stream_Free)("FT_Stream_Free", lib);
301     bindFunc(FT_Stream_OpenMemory)("FT_Stream_OpenMemory", lib);
302     bindFunc(FT_Stream_Close)("FT_Stream_Close", lib);
303     bindFunc(FT_Stream_Seek)("FT_Stream_Seek", lib);
304     bindFunc(FT_Stream_Skip)("FT_Stream_Skip", lib);
305     bindFunc(FT_Stream_Pos)("FT_Stream_Pos", lib);
306     bindFunc(FT_Stream_Read)("FT_Stream_Read", lib);
307     bindFunc(FT_Stream_ReadAt)("FT_Stream_ReadAt", lib);
308     bindFunc(FT_Stream_TryRead)("FT_Stream_TryRead", lib);
309     bindFunc(FT_Stream_EnterFrame)("FT_Stream_EnterFrame", lib);
310     bindFunc(FT_Stream_ExitFrame)("FT_Stream_ExitFrame", lib);
311     bindFunc(FT_Stream_ExtractFrame)("FT_Stream_ExtractFrame", lib);
312     bindFunc(FT_Stream_ReleaseFrame)("FT_Stream_ReleaseFrame", lib);
313     bindFunc(FT_Stream_GetChar)("FT_Stream_GetChar", lib);
314     bindFunc(FT_Stream_GetShort)("FT_Stream_GetShort", lib);
315     bindFunc(FT_Stream_GetOffset)("FT_Stream_GetOffset", lib);
316     bindFunc(FT_Stream_GetLong)("FT_Stream_GetLong", lib);
317     bindFunc(FT_Stream_GetShortLE)("FT_Stream_GetShortLE", lib);
318     bindFunc(FT_Stream_GetLongLE)("FT_Stream_GetLongLE", lib);
319     bindFunc(FT_Stream_ReadChar)("FT_Stream_ReadChar", lib);
320     bindFunc(FT_Stream_ReadShort)("FT_Stream_ReadShort", lib);
321     bindFunc(FT_Stream_ReadOffset)("FT_Stream_ReadOffset", lib);
322     bindFunc(FT_Stream_ReadLong)("FT_Stream_ReadLong", lib);
323     bindFunc(FT_Stream_ReadShortLE)("FT_Stream_ReadShortLE", lib);
324     bindFunc(FT_Stream_ReadLongLE)("FT_Stream_ReadLongLE", lib);
325     bindFunc(FT_Stream_ReadFields)("FT_Stream_ReadFields", lib);
326     bindFunc(FT_Trace_Get_Count)("FT_Trace_Get_Count", lib);
327     bindFunc(FT_Trace_Get_Name)("FT_Trace_Get_Name", lib);
328     bindFunc(ft_debug_init)("ft_debug_init", lib);
329     bindFunc(FT_SqrtFixed)("FT_SqrtFixed", lib);
330     bindFunc(FT_Raccess_Guess)("FT_Raccess_Guess", lib);
331     bindFunc(FT_Raccess_Get_HeaderInfo)("FT_Raccess_Get_HeaderInfo", lib);
332     bindFunc(FT_Raccess_Get_DataOffsets)("FT_Raccess_Get_DataOffsets", lib);
333     bindFunc(ft_validator_init)("ft_validator_init", lib);
334     bindFunc(ft_validator_run)("ft_validator_run", lib);
335     bindFunc(ft_validator_error)("ft_validator_error", lib);
336     +/
337 }
338
339 GenericLoader DerelictFT;
340 static this() {
341     DerelictFT.setup(
342         "freetype.dll",
343         "libfreetype.so.6,libfreetype.so",
344         "libfreetype.dylib,libfreetype.6.dylib,libfreetype.6.3.16.dylib",
345         &loadFT,
346         "2.1.10"
347     );
348 }
349
350
351 // C calling convention for BOTH linux and Windows
352 extern(C):
353
354
355 //BEGIN Typedefs
356 // freetype.h (FT_FREETYPE_H)
357 typedef FT_Error function( FT_Library *alibrary ) pfFT_Init_FreeType;
358 typedef FT_Error function( FT_Library library ) pfFT_Done_FreeType;
359 typedef FT_Error function( FT_Library library, char* filepathname, FT_Long face_index, FT_Face *aface ) pfFT_New_Face;
360 typedef FT_Error function( FT_Library library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface ) pfFT_New_Memory_Face;
361 typedef FT_Error function( FT_Library library, FT_Open_Args* args, FT_Long face_index, FT_Face *aface ) pfFT_Open_Face;
362 typedef FT_Error function( FT_Face face, char* filepathname ) pfFT_Attach_File;
363 typedef FT_Error function( FT_Face face, FT_Open_Args* parameters ) pfFT_Attach_Stream;
364 typedef FT_Error function( FT_Face face ) pfFT_Done_Face;
365 typedef FT_Error function( FT_Face face, FT_Int strike_index ) pfFT_Select_Size;
366 typedef FT_Error function( FT_Face face, FT_Size_Request req ) pfFT_Request_Size;
367 typedef FT_Error function( FT_Face face, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt horz_resolution, FT_UInt vert_resolution ) pfFT_Set_Char_Size;
368 typedef FT_Error function( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ) pfFT_Set_Pixel_Sizes;
369 typedef FT_Error function( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ) pfFT_Load_Glyph;
370 typedef FT_Error function( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ) pfFT_Load_Char;
371 typedef void function( FT_Face face, FT_Matrix* matrix, FT_Vector* delta ) pfFT_Set_Transform;
372 typedef FT_Error function( FT_GlyphSlot slot, FT_Render_Mode render_mode ) pfFT_Render_Glyph;
373 typedef FT_Error function( FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning ) pfFT_Get_Kerning;
374 typedef FT_Error function( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed* akerning ) pfFT_Get_Track_Kerning;
375 typedef FT_Error function( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ) pfFT_Get_Glyph_Name;
376 typedef char* function( FT_Face face ) pfFT_Get_Postscript_Name;
377 typedef FT_Error function( FT_Face face, FT_Encoding encoding ) pfFT_Select_Charmap;
378 typedef FT_Error function( FT_Face face, FT_CharMap charmap ) pfFT_Set_Charmap;
379 typedef FT_Int function( FT_CharMap charmap ) pfFT_Get_Charmap_Index;
380 typedef FT_UInt function( FT_Face face, FT_ULong charcode ) pfFT_Get_Char_Index;
381 typedef FT_ULong function( FT_Face face, FT_UInt *agindex ) pfFT_Get_First_Char;
382 typedef FT_ULong function( FT_Face face, FT_ULong char_code, FT_UInt *agindex ) pfFT_Get_Next_Char;
383 typedef FT_UInt function( FT_Face face, FT_String* glyph_name ) pfFT_Get_Name_Index;
384 typedef FT_Long function( FT_Long a, FT_Long b, FT_Long c ) pfFT_MulDiv;
385 typedef FT_Long function( FT_Long a, FT_Long b ) pfFT_MulFix;
386 typedef FT_Long function( FT_Long a, FT_Long b ) pfFT_DivFix;
387 typedef FT_Fixed function( FT_Fixed a ) pfFT_RoundFix;
388 typedef FT_Fixed function( FT_Fixed a ) pfFT_CeilFix;
389 typedef FT_Fixed function( FT_Fixed a ) pfFT_FloorFix;
390 typedef void function( FT_Vector* vec, FT_Matrix* matrix ) pfFT_Vector_Transform;
391 typedef void function( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ) pfFT_Library_Version;
392 typedef FT_Bool function( FT_Face face ) pfFT_Face_CheckTrueTypePatents;
393 typedef FT_Bool function( FT_Face face, FT_Bool value ) pfFT_Face_SetUnpatentedHinting;
394
395 // ftlist.h (FT_LIST_H)
396 typedef FT_ListNode function( FT_List list, void* data ) pfFT_List_Find;
397 typedef void function( FT_List list, FT_ListNode node ) pfFT_List_Add;
398 typedef void function( FT_List list, FT_ListNode node ) pfFT_List_Insert;
399 typedef void function( FT_List list, FT_ListNode node ) pfFT_List_Remove;
400 typedef void function( FT_List list, FT_ListNode node ) pfFT_List_Up;
401 typedef FT_Error function( FT_List list, FT_List_Iterator iterator, void* user ) pfFT_List_Iterate;
402 typedef void function( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void* user ) pfFT_List_Finalize;
403
404 // ftoutln.h (FT_OUTLINE_H, FT_STROKER_H)
405 typedef FT_Error function( FT_Outline* outline, FT_Outline_Funcs* func_interface, void* user ) pfFT_Outline_Decompose;
406 typedef FT_Error function( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ) pfFT_Outline_New;
407 typedef FT_Error function( FT_Memory memory, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ) pfFT_Outline_New_Internal;
408 typedef FT_Error function( FT_Library library, FT_Outline* outline ) pfFT_Outline_Done;
409 typedef FT_Error function( FT_Memory memory, FT_Outline* outline ) pfFT_Outline_Done_Internal;
410 typedef FT_Error function( FT_Outline* outline ) pfFT_Outline_Check;
411 typedef void function( FT_Outline* outline, FT_BBox *acbox ) pfFT_Outline_Get_CBox;
412 typedef void function( FT_Outline* outline, FT_Pos xOffset, FT_Pos yOffset ) pfFT_Outline_Translate;
413 typedef FT_Error function( FT_Outline* source, FT_Outline *target ) pfFT_Outline_Copy;
414 typedef void function( FT_Outline* outline, FT_Matrix* matrix ) pfFT_Outline_Transform;
415 typedef FT_Error function( FT_Outline* outline, FT_Pos strength ) pfFT_Outline_Embolden;
416 typedef void function( FT_Outline* outline ) pfFT_Outline_Reverse;
417 typedef FT_Error function( FT_Library library, FT_Outline* outline, FT_Bitmap *abitmap ) pfFT_Outline_Get_Bitmap;
418 typedef FT_Error function( FT_Library library, FT_Outline* outline, FT_Raster_Params* params ) pfFT_Outline_Render;
419 typedef FT_Orientation function( FT_Outline* outline ) pfFT_Outline_Get_Orientation;
420
421 // ftsizes.h (FT_SIZES_H)
422 typedef FT_Error function( FT_Face face, FT_Size* size ) pfFT_New_Size;
423 typedef FT_Error function( FT_Size size ) pfFT_Done_Size;
424 typedef FT_Error function( FT_Size size ) pfFT_Activate_Size;
425
426 // ftmodapi.h (FT_MODULE_H, FT_RENDER_H)
427 typedef FT_Error function( FT_Library library, FT_Module_Class* clazz ) pfFT_Add_Module;
428 typedef FT_Module function( FT_Library library, char* module_name ) pfFT_Get_Module;
429 typedef FT_Error function( FT_Library library, FT_Module mod ) pfFT_Remove_Module;
430 typedef FT_Error function( FT_Memory memory, FT_Library *alibrary ) pfFT_New_Library;
431 typedef FT_Error function( FT_Library library ) pfFT_Done_Library;
432 typedef void function( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ) pfFT_Set_Debug_Hook;
433 typedef void function( FT_Library library ) pfFT_Add_Default_Modules;
434 typedef FT_TrueTypeEngineType function( FT_Library library ) pfFT_Get_TrueType_Engine_Type;
435
436 // ftrender.h (FT_RENDER_H)
437 typedef FT_Renderer function( FT_Library library, FT_Glyph_Format format ) pfFT_Get_Renderer;
438 typedef FT_Error function( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter* parameters ) pfFT_Set_Renderer;
439
440 // t1tables.h (FT_TYPE1_TABLES_H)
441 typedef FT_Int function( FT_Face face ) pfFT_Has_PS_Glyph_Names;
442 typedef FT_Error function( FT_Face face, PS_FontInfoRec *afont_info ) pfFT_Get_PS_Font_Info;
443 typedef FT_Error function( FT_Face face, PS_PrivateRec *afont_private ) pfFT_Get_PS_Font_Private;
444
445 // tttables.h (FT_TRUETYPE_TABLES_H)
446 typedef void* function( FT_Face face, FT_Sfnt_Tag tag ) pfFT_Get_Sfnt_Table;
447 typedef FT_Error function( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte* buffer, FT_ULong* length ) pfFT_Load_Sfnt_Table;
448 typedef FT_Error function( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ) pfFT_Sfnt_Table_Info;
449 typedef FT_ULong function( FT_CharMap charmap ) pfFT_Get_CMap_Language_ID;
450 typedef FT_ULong function( FT_CharMap charmap ) pfFT_Get_CMap_Format;
451
452 // ftbdf.h (FT_BDF_H)
453 typedef FT_Error function( FT_Face face, char* *acharset_encoding, char* *acharset_registry ) pfFT_Get_BDF_Charset_ID;
454 typedef FT_Error function( FT_Face face, char* prop_name, BDF_PropertyRec *aproperty ) pfFT_Get_BDF_Property;
455
456 // ftgzip.h (FT_GZIP_H)
457 typedef FT_Error function( FT_Stream stream, FT_Stream source ) pfFT_Stream_OpenGzip;
458
459 // ftlzw.h (FT_LZW_H)
460 typedef FT_Error function( FT_Stream stream, FT_Stream source ) pfFT_Stream_OpenLZW;
461
462 // ftwinfnt.h (FT_WINFONTS_H)
463 typedef FT_Error function( FT_Face face, FT_WinFNT_HeaderRec *aheader ) pfFT_Get_WinFNT_Header;
464
465 // ftglyph.h (FT_GLYPH_H, FT_CACHE_H, FT_STROKER_H)
466 typedef FT_Error function( FT_GlyphSlot slot, FT_Glyph *aglyph ) pfFT_Get_Glyph;
467 typedef FT_Error function( FT_Glyph source, FT_Glyph *target ) pfFT_Glyph_Copy;
468 typedef FT_Error function( FT_Glyph glyph, FT_Matrix* matrix, FT_Vector* delta ) pfFT_Glyph_Transform;
469 typedef void function( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ) pfFT_Glyph_Get_CBox;
470 typedef FT_Error function( FT_Glyph* the_glyph, FT_Render_Mode render_mode, FT_Vector* origin, FT_Bool destroy ) pfFT_Glyph_To_Bitmap;
471 typedef void function( FT_Glyph glyph ) pfFT_Done_Glyph;
472 typedef void function( FT_Matrix* a, FT_Matrix* b ) pfFT_Matrix_Multiply;
473 typedef FT_Error function( FT_Matrix* matrix ) pfFT_Matrix_Invert;
474
475 // ftbitmap.h (FT_BITMAP_H)
476 typedef void function( FT_Bitmap *abitmap ) pfFT_Bit