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.ftwinfnt;
8 
9 import bindbc.freetype.config;
10 import bindbc.freetype.bind.freetype,
11        bindbc.freetype.bind.fttypes;
12 
13 enum {
14     FT_WinFNT_ID_CP1252 = 0,
15     FT_WinFNT_ID_DEFAULT = 1,
16     FT_WinFNT_ID_SYMBOL = 2,
17     FT_WinFNT_ID_MAC = 77,
18     FT_WinFNT_ID_CP932 = 128,
19     FT_WinFNT_ID_CP949 = 129,
20     FT_WinFNT_ID_CP1361 = 130,
21     FT_WinFNT_ID_CP936 = 134,
22     FT_WinFNT_ID_CP950 = 136,
23     FT_WinFNT_ID_CP1253 = 161,
24     FT_WinFNT_ID_CP1254 = 162,
25     FT_WinFNT_ID_CP1258 = 163,
26     FT_WinFNT_ID_CP1255 = 177,
27     FT_WinFNT_ID_CP1256 = 178,
28     FT_WinFNT_ID_CP1257 = 186,
29     FT_WinFNT_ID_CP1251 = 204,
30     FT_WinFNT_ID_CP874 = 222,
31     FT_WinFNT_ID_CP1250 = 238,
32     FT_WinFNT_ID_OEM = 255,
33 }
34 
35 
36 struct FT_WinFNT_HeaderRec {
37     FT_UShort _version;
38     FT_ULong file_size;
39     FT_Byte[60] copyright;
40     FT_UShort file_type;
41     FT_UShort nominal_point_size;
42     FT_UShort vertical_resolution;
43     FT_UShort horizontal_resolution;
44     FT_UShort ascent;
45     FT_UShort internal_leading;
46     FT_UShort external_leading;
47     FT_Byte italic;
48     FT_Byte underline;
49     FT_Byte strike_out;
50     FT_UShort weight;
51     FT_Byte charset;
52     FT_UShort pixel_width;
53     FT_UShort pixel_height;
54     FT_Byte pitch_and_family;
55     FT_UShort avg_width;
56     FT_UShort max_width;
57     FT_Byte first_char;
58     FT_Byte last_char;
59     FT_Byte default_char;
60     FT_Byte break_char;
61     FT_UShort bytes_per_row;
62     FT_ULong device_offset;
63     FT_ULong face_name_offset;
64     FT_ULong bits_pointer;
65     FT_ULong bits_offset;
66     FT_Byte reserved;
67     FT_ULong flags;
68     FT_UShort A_space;
69     FT_UShort B_space;
70     FT_UShort C_space;
71     FT_UShort color_table_offset;
72     FT_ULong[4] reserved1;
73 }
74 
75 alias FT_WinFNT_Header = FT_WinFNT_HeaderRec*;
76 
77 static if(staticBinding) {
78 	extern(C) @nogc nothrow {
79         FT_Error FT_Get_WinFNT_Header(FT_Face face, FT_WinFNT_HeaderRec* aheader);
80     }
81 }
82 else {
83     extern(C) @nogc nothrow {
84         alias pFT_Get_WinFNT_Header = FT_Error function(FT_Face face, FT_WinFNT_HeaderRec* aheader);
85     }
86 
87     __gshared {
88          pFT_Get_WinFNT_Header FT_Get_WinFNT_Header;
89     }
90 }