1 
2 //          Copyright 2019 - 2021 Michael D. Parker
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.ftoutln;
8 
9 import bindbc.freetype.config;
10 import bindbc.freetype.bind.freetype,
11        bindbc.freetype.bind.ftimage,
12        bindbc.freetype.bind.fttypes;
13 
14 alias FT_Orientation = int;
15 enum {
16     FT_ORIENTATION_TRUETYPE = 0,
17     FT_ORIENTATION_POSTSCRIPT = 1,
18     FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
19     FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT
20 }
21 
22 static if(staticBinding) {
23 	extern(C) @nogc nothrow {
24         FT_Error FT_Outline_Decompose(FT_Outline* outline, const(FT_Outline_Funcs)* func_interface, void* user);
25         FT_Error FT_Outline_New(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline* anoutline);
26         FT_Error FT_Outline_Done(FT_Library library, FT_Outline* outline);
27         FT_Error FT_Outline_Check(FT_Outline* outline);
28         void FT_Outline_Get_CBox(const(FT_Outline)* outline, FT_BBox* acboc);
29         void FT_Outline_Translate(const(FT_Outline)* outline, FT_Pos xoffset, FT_Pos yoffset);
30         FT_Error FT_Outline_Copy(const(FT_Outline)* outline, FT_Outline* target);
31         void FT_Outline_Transform(const(FT_Outline)* outline, const(FT_Matrix)* matrix);
32         FT_Error FT_Outline_Embolden(FT_Outline* outline, FT_Pos strength);
33         FT_Error FT_Outline_EmboldenXY(FT_Outline* outline, FT_Pos xstrength, FT_Pos ystrength);
34         void FT_Outline_Reverse(FT_Outline* outline);
35         FT_Error FT_Outline_Get_Bitmap(FT_Library library, FT_Outline* outline, const(FT_Bitmap)* abitmap);
36         FT_Error FT_Outline_Render(FT_Library library, FT_Outline* outline, FT_Raster_Params* params);
37         FT_Orientation FT_Outline_Get_Orientation(FT_Outline* outline);
38     }
39 }
40 else {
41     extern(C) @nogc nothrow {
42         alias pFT_Outline_Decompose = FT_Error function(FT_Outline* outline, const(FT_Outline_Funcs)* func_interface, void* user);
43         alias pFT_Outline_New = FT_Error function(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline* anoutline);
44         alias pFT_Outline_Done = FT_Error function(FT_Library library, FT_Outline* outline);
45         alias pFT_Outline_Check = FT_Error function(FT_Outline* outline);
46         alias pFT_Outline_Get_CBox = void function(const(FT_Outline)* outline, FT_BBox* acbox);
47         alias pFT_Outline_Translate = void function(const(FT_Outline)* outline, FT_Pos xoffset, FT_Pos yoffset);
48         alias pFT_Outline_Copy = FT_Error function(const(FT_Outline)* outline,FT_Outline* target);
49         alias pFT_Outline_Transform = void function(const(FT_Outline)* outline, const(FT_Matrix)* matrix);
50         alias pFT_Outline_Embolden = FT_Error function(FT_Outline* outline, FT_Pos strength);
51         alias pFT_Outline_EmboldenXY = FT_Error function(FT_Outline* outline, FT_Pos xstrength, FT_Pos ystrength);
52         alias pFT_Outline_Reverse = void function(FT_Outline* outline);
53         alias pFT_Outline_Get_Bitmap = FT_Error function(FT_Library library, FT_Outline* outline, const(FT_Bitmap)* abitmap);
54         alias pFT_Outline_Render = FT_Error function(FT_Library library, FT_Outline* outline, FT_Raster_Params* params);
55         alias pFT_Outline_Get_Orientation = FT_Orientation function(FT_Outline* outline);
56     }
57 
58     __gshared {
59         pFT_Outline_Decompose FT_Outline_Decompose;
60         pFT_Outline_New FT_Outline_New;
61         pFT_Outline_Done FT_Outline_Done;
62         pFT_Outline_Check FT_Outline_Check;
63         pFT_Outline_Get_CBox FT_Outline_Get_CBox;
64         pFT_Outline_Translate FT_Outline_Translate;
65         pFT_Outline_Copy FT_Outline_Copy;
66         pFT_Outline_Transform FT_Outline_Transform;
67         pFT_Outline_Embolden FT_Outline_Embolden;
68         pFT_Outline_EmboldenXY FT_Outline_EmboldenXY;
69         pFT_Outline_Reverse FT_Outline_Reverse;
70         pFT_Outline_Get_Bitmap FT_Outline_Get_Bitmap;
71         pFT_Outline_Render FT_Outline_Render;
72         pFT_Outline_Get_Orientation FT_Outline_Get_Orientation;
73     }
74 }