-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDL3_ttf.cs
304 lines (211 loc) · 17.2 KB
/
SDL3_ttf.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
using System;
using System.Runtime.InteropServices;
namespace DeafMan1983.Interop.SDL3
{
public partial struct TTF_Font
{
}
public static unsafe partial class SDL3
{
[NativeTypeName("unsigned int")]
public enum TTF_Direction : uint
{
}
public static TTF_Direction TTF_DIRECTION_LTR = 0,
TTF_DIRECTION_RTL,
TTF_DIRECTION_TTB,
TTF_DIRECTION_BTT;
private const string libSDL3_TTF = "SDL3_ttf";
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("const SDL_version *")]
public static extern SDL_version* TTF_Linked_Version();
[DllImport(libSDL3_TTF)]
public static extern void TTF_GetFreeTypeVersion(int* major, int* minor, int* patch);
[DllImport(libSDL3_TTF)]
public static extern void TTF_GetHarfBuzzVersion(int* major, int* minor, int* patch);
[DllImport(libSDL3_TTF)]
public static extern void TTF_ByteSwappedUNICODE(int swapped);
[DllImport(libSDL3_TTF)]
public static extern int TTF_Init();
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFont([NativeTypeName("const char *")] sbyte* file, int ptsize);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontIndex([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] nint index);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontRW(SDL_RWops* src, int freesrc, int ptsize);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontIndexRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] nint index);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontIndexDPI([NativeTypeName("const char *")] sbyte* file, int ptsize, [NativeTypeName("long")] nint index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("TTF_Font *")]
public static extern TTF_Font* TTF_OpenFontIndexDPIRW(SDL_RWops* src, int freesrc, int ptsize, [NativeTypeName("long")] nint index, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SetFontSize([NativeTypeName("TTF_Font *")] TTF_Font* font, int ptsize);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SetFontSizeDPI([NativeTypeName("TTF_Font *")] TTF_Font* font, int ptsize, [NativeTypeName("unsigned int")] uint hdpi, [NativeTypeName("unsigned int")] uint vdpi);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontStyle([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_SetFontStyle([NativeTypeName("TTF_Font *")] TTF_Font* font, int style);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontOutline([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_SetFontOutline([NativeTypeName("TTF_Font *")] TTF_Font* font, int outline);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontHinting([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_SetFontHinting([NativeTypeName("TTF_Font *")] TTF_Font* font, int hinting);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontWrappedAlign([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_SetFontWrappedAlign([NativeTypeName("TTF_Font *")] TTF_Font* font, int align);
[DllImport(libSDL3_TTF)]
public static extern int TTF_FontHeight([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_FontAscent([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_FontDescent([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_FontLineSkip([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontKerning([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_SetFontKerning([NativeTypeName("TTF_Font *")] TTF_Font* font, int allowed);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("long")]
public static extern nint TTF_FontFaces([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_FontFaceIsFixedWidth([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("const char *")]
public static extern sbyte* TTF_FontFaceFamilyName([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
[return: NativeTypeName("const char *")]
public static extern sbyte* TTF_FontFaceStyleName([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GlyphIsProvided([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GlyphIsProvided32([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GlyphMetrics([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, int* minx, int* maxx, int* miny, int* maxy, int* advance);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GlyphMetrics32([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch, int* minx, int* maxx, int* miny, int* maxy, int* advance);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SizeText([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SizeUTF8([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int* w, int* h);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SizeUNICODE([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int* w, int* h);
[DllImport(libSDL3_TTF)]
public static extern int TTF_MeasureText([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count);
[DllImport(libSDL3_TTF)]
public static extern int TTF_MeasureUTF8([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, int measure_width, int* extent, int* count);
[DllImport(libSDL3_TTF)]
public static extern int TTF_MeasureUNICODE([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, int measure_width, int* extent, int* count);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Solid([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Solid([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Solid([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Solid_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Solid_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Solid_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph_Solid([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph32_Solid([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Shaded([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Shaded([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Shaded([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Shaded_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Shaded_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Shaded_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph_Shaded([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph32_Shaded([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Blended([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Blended([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Blended([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_Blended_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_Blended_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_Blended_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph_Blended([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph32_Blended([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_LCD([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_LCD([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_LCD([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderText_LCD_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUTF8_LCD_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderUNICODE_LCD_Wrapped([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const Uint16 *")] ushort* text, SDL_Color fg, SDL_Color bg, [NativeTypeName("Uint32")] uint wrapLength);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph_LCD([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort ch, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern SDL_Surface* TTF_RenderGlyph32_LCD([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint ch, SDL_Color fg, SDL_Color bg);
[DllImport(libSDL3_TTF)]
public static extern void TTF_CloseFont([NativeTypeName("TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
public static extern void TTF_Quit();
[DllImport(libSDL3_TTF)]
public static extern int TTF_WasInit();
[DllImport(libSDL3_TTF)]
[Obsolete]
public static extern int TTF_GetFontKerningSize([NativeTypeName("TTF_Font *")] TTF_Font* font, int prev_index, int index);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontKerningSizeGlyphs([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint16")] ushort previous_ch, [NativeTypeName("Uint16")] ushort ch);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontKerningSizeGlyphs32([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("Uint32")] uint previous_ch, [NativeTypeName("Uint32")] uint ch);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SetFontSDF([NativeTypeName("TTF_Font *")] TTF_Font* font, int on_off);
[DllImport(libSDL3_TTF)]
public static extern int TTF_GetFontSDF([NativeTypeName("const TTF_Font *")] TTF_Font* font);
[DllImport(libSDL3_TTF)]
[Obsolete]
public static extern int TTF_SetDirection(int direction);
[DllImport(libSDL3_TTF)]
[Obsolete]
public static extern int TTF_SetScript(int script);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SetFontDirection([NativeTypeName("TTF_Font *")] TTF_Font* font, TTF_Direction direction);
[DllImport(libSDL3_TTF)]
public static extern int TTF_SetFontScriptName([NativeTypeName("TTF_Font *")] TTF_Font* font, [NativeTypeName("const char *")] sbyte* script);
[DllImport(libSDL3_TTF)]
public static extern int TTF_IsFontScalable([NativeTypeName("const TTF_Font *")] TTF_Font* font);
}
}