sdl2-bindings 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +145 -134
- data/LICENSE.txt +0 -0
- data/README.md +108 -86
- data/lib/sdl2.rb +131 -131
- data/lib/sdl2_audio.rb +265 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +137 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +575 -564
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +345 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_guid.rb +58 -0
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +240 -221
- data/lib/sdl2_image.rb +296 -296
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +332 -294
- data/lib/sdl2_keyboard.rb +129 -125
- data/lib/sdl2_keycode.rb +311 -307
- data/lib/sdl2_log.rb +131 -131
- data/lib/sdl2_main.rb +74 -74
- data/lib/sdl2_messagebox.rb +102 -102
- data/lib/sdl2_misc.rb +48 -48
- data/lib/sdl2_mixer.rb +464 -464
- data/lib/sdl2_mouse.rb +136 -136
- data/lib/sdl2_pixels.rb +240 -240
- data/lib/sdl2_platform.rb +48 -48
- data/lib/sdl2_power.rb +54 -54
- data/lib/sdl2_rect.rb +145 -145
- data/lib/sdl2_render.rb +408 -408
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -242
- data/lib/sdl2_scancode.rb +293 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -154
- data/lib/sdl2_stdinc.rb +572 -548
- data/lib/sdl2_surface.rb +229 -229
- data/lib/sdl2_syswm.rb +160 -160
- data/lib/sdl2_timer.rb +74 -74
- data/lib/sdl2_touch.rb +86 -86
- data/lib/sdl2_ttf.rb +414 -414
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +549 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +4 -3
data/lib/sdl2_ttf.rb
CHANGED
@@ -1,414 +1,414 @@
|
|
1
|
-
# Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
|
2
|
-
#
|
3
|
-
# * https://github.com/vaiorabbit/sdl2-bindings
|
4
|
-
#
|
5
|
-
# [NOTICE] This is an automatically generated file.
|
6
|
-
|
7
|
-
require 'ffi'
|
8
|
-
require_relative 'sdl2_pixels'
|
9
|
-
|
10
|
-
module SDL
|
11
|
-
extend FFI::Library
|
12
|
-
# Define/Macro
|
13
|
-
|
14
|
-
TTF_MAJOR_VERSION = 2
|
15
|
-
TTF_MINOR_VERSION = 20
|
16
|
-
TTF_PATCHLEVEL =
|
17
|
-
TTF_STYLE_NORMAL = 0x00
|
18
|
-
TTF_STYLE_BOLD = 0x01
|
19
|
-
TTF_STYLE_ITALIC = 0x02
|
20
|
-
TTF_STYLE_UNDERLINE = 0x04
|
21
|
-
TTF_STYLE_STRIKETHROUGH = 0x08
|
22
|
-
TTF_HINTING_NORMAL = 0
|
23
|
-
TTF_HINTING_LIGHT = 1
|
24
|
-
TTF_HINTING_MONO = 2
|
25
|
-
TTF_HINTING_NONE = 3
|
26
|
-
TTF_HINTING_LIGHT_SUBPIXEL = 4
|
27
|
-
TTF_WRAPPED_ALIGN_LEFT = 0
|
28
|
-
TTF_WRAPPED_ALIGN_CENTER = 1
|
29
|
-
TTF_WRAPPED_ALIGN_RIGHT = 2
|
30
|
-
|
31
|
-
# Enum
|
32
|
-
|
33
|
-
TTF_DIRECTION_LTR = 0
|
34
|
-
TTF_DIRECTION_RTL = 1
|
35
|
-
TTF_DIRECTION_TTB = 2
|
36
|
-
TTF_DIRECTION_BTT = 3
|
37
|
-
|
38
|
-
# Typedef
|
39
|
-
|
40
|
-
typedef :int, :TTF_Direction
|
41
|
-
|
42
|
-
# Struct
|
43
|
-
|
44
|
-
|
45
|
-
# Function
|
46
|
-
|
47
|
-
def self.setup_ttf_symbols(output_error = false)
|
48
|
-
symbols = [
|
49
|
-
:TTF_Linked_Version,
|
50
|
-
:TTF_GetFreeTypeVersion,
|
51
|
-
:TTF_GetHarfBuzzVersion,
|
52
|
-
:TTF_ByteSwappedUNICODE,
|
53
|
-
:TTF_Init,
|
54
|
-
:TTF_OpenFont,
|
55
|
-
:TTF_OpenFontIndex,
|
56
|
-
:TTF_OpenFontRW,
|
57
|
-
:TTF_OpenFontIndexRW,
|
58
|
-
:TTF_OpenFontDPI,
|
59
|
-
:TTF_OpenFontIndexDPI,
|
60
|
-
:TTF_OpenFontDPIRW,
|
61
|
-
:TTF_OpenFontIndexDPIRW,
|
62
|
-
:TTF_SetFontSize,
|
63
|
-
:TTF_SetFontSizeDPI,
|
64
|
-
:TTF_GetFontStyle,
|
65
|
-
:TTF_SetFontStyle,
|
66
|
-
:TTF_GetFontOutline,
|
67
|
-
:TTF_SetFontOutline,
|
68
|
-
:TTF_GetFontHinting,
|
69
|
-
:TTF_SetFontHinting,
|
70
|
-
:TTF_GetFontWrappedAlign,
|
71
|
-
:TTF_SetFontWrappedAlign,
|
72
|
-
:TTF_FontHeight,
|
73
|
-
:TTF_FontAscent,
|
74
|
-
:TTF_FontDescent,
|
75
|
-
:TTF_FontLineSkip,
|
76
|
-
:TTF_GetFontKerning,
|
77
|
-
:TTF_SetFontKerning,
|
78
|
-
:TTF_FontFaces,
|
79
|
-
:TTF_FontFaceIsFixedWidth,
|
80
|
-
:TTF_FontFaceFamilyName,
|
81
|
-
:TTF_FontFaceStyleName,
|
82
|
-
:TTF_GlyphIsProvided,
|
83
|
-
:TTF_GlyphIsProvided32,
|
84
|
-
:TTF_GlyphMetrics,
|
85
|
-
:TTF_GlyphMetrics32,
|
86
|
-
:TTF_SizeText,
|
87
|
-
:TTF_SizeUTF8,
|
88
|
-
:TTF_SizeUNICODE,
|
89
|
-
:TTF_MeasureText,
|
90
|
-
:TTF_MeasureUTF8,
|
91
|
-
:TTF_MeasureUNICODE,
|
92
|
-
:TTF_RenderText_Solid,
|
93
|
-
:TTF_RenderUTF8_Solid,
|
94
|
-
:TTF_RenderUNICODE_Solid,
|
95
|
-
:TTF_RenderText_Solid_Wrapped,
|
96
|
-
:TTF_RenderUTF8_Solid_Wrapped,
|
97
|
-
:TTF_RenderUNICODE_Solid_Wrapped,
|
98
|
-
:TTF_RenderGlyph_Solid,
|
99
|
-
:TTF_RenderGlyph32_Solid,
|
100
|
-
:TTF_RenderText_Shaded,
|
101
|
-
:TTF_RenderUTF8_Shaded,
|
102
|
-
:TTF_RenderUNICODE_Shaded,
|
103
|
-
:TTF_RenderText_Shaded_Wrapped,
|
104
|
-
:TTF_RenderUTF8_Shaded_Wrapped,
|
105
|
-
:TTF_RenderUNICODE_Shaded_Wrapped,
|
106
|
-
:TTF_RenderGlyph_Shaded,
|
107
|
-
:TTF_RenderGlyph32_Shaded,
|
108
|
-
:TTF_RenderText_Blended,
|
109
|
-
:TTF_RenderUTF8_Blended,
|
110
|
-
:TTF_RenderUNICODE_Blended,
|
111
|
-
:TTF_RenderText_Blended_Wrapped,
|
112
|
-
:TTF_RenderUTF8_Blended_Wrapped,
|
113
|
-
:TTF_RenderUNICODE_Blended_Wrapped,
|
114
|
-
:TTF_RenderGlyph_Blended,
|
115
|
-
:TTF_RenderGlyph32_Blended,
|
116
|
-
:TTF_RenderText_LCD,
|
117
|
-
:TTF_RenderUTF8_LCD,
|
118
|
-
:TTF_RenderUNICODE_LCD,
|
119
|
-
:TTF_RenderText_LCD_Wrapped,
|
120
|
-
:TTF_RenderUTF8_LCD_Wrapped,
|
121
|
-
:TTF_RenderUNICODE_LCD_Wrapped,
|
122
|
-
:TTF_RenderGlyph_LCD,
|
123
|
-
:TTF_RenderGlyph32_LCD,
|
124
|
-
:TTF_CloseFont,
|
125
|
-
:TTF_Quit,
|
126
|
-
:TTF_WasInit,
|
127
|
-
:TTF_GetFontKerningSize,
|
128
|
-
:TTF_GetFontKerningSizeGlyphs,
|
129
|
-
:TTF_GetFontKerningSizeGlyphs32,
|
130
|
-
:TTF_SetFontSDF,
|
131
|
-
:TTF_GetFontSDF,
|
132
|
-
:TTF_SetDirection,
|
133
|
-
:TTF_SetScript,
|
134
|
-
:TTF_SetFontDirection,
|
135
|
-
:TTF_SetFontScriptName,
|
136
|
-
]
|
137
|
-
apis = {
|
138
|
-
:TTF_Linked_Version => :TTF_Linked_Version,
|
139
|
-
:TTF_GetFreeTypeVersion => :TTF_GetFreeTypeVersion,
|
140
|
-
:TTF_GetHarfBuzzVersion => :TTF_GetHarfBuzzVersion,
|
141
|
-
:TTF_ByteSwappedUNICODE => :TTF_ByteSwappedUNICODE,
|
142
|
-
:TTF_Init => :TTF_Init,
|
143
|
-
:TTF_OpenFont => :TTF_OpenFont,
|
144
|
-
:TTF_OpenFontIndex => :TTF_OpenFontIndex,
|
145
|
-
:TTF_OpenFontRW => :TTF_OpenFontRW,
|
146
|
-
:TTF_OpenFontIndexRW => :TTF_OpenFontIndexRW,
|
147
|
-
:TTF_OpenFontDPI => :TTF_OpenFontDPI,
|
148
|
-
:TTF_OpenFontIndexDPI => :TTF_OpenFontIndexDPI,
|
149
|
-
:TTF_OpenFontDPIRW => :TTF_OpenFontDPIRW,
|
150
|
-
:TTF_OpenFontIndexDPIRW => :TTF_OpenFontIndexDPIRW,
|
151
|
-
:TTF_SetFontSize => :TTF_SetFontSize,
|
152
|
-
:TTF_SetFontSizeDPI => :TTF_SetFontSizeDPI,
|
153
|
-
:TTF_GetFontStyle => :TTF_GetFontStyle,
|
154
|
-
:TTF_SetFontStyle => :TTF_SetFontStyle,
|
155
|
-
:TTF_GetFontOutline => :TTF_GetFontOutline,
|
156
|
-
:TTF_SetFontOutline => :TTF_SetFontOutline,
|
157
|
-
:TTF_GetFontHinting => :TTF_GetFontHinting,
|
158
|
-
:TTF_SetFontHinting => :TTF_SetFontHinting,
|
159
|
-
:TTF_GetFontWrappedAlign => :TTF_GetFontWrappedAlign,
|
160
|
-
:TTF_SetFontWrappedAlign => :TTF_SetFontWrappedAlign,
|
161
|
-
:TTF_FontHeight => :TTF_FontHeight,
|
162
|
-
:TTF_FontAscent => :TTF_FontAscent,
|
163
|
-
:TTF_FontDescent => :TTF_FontDescent,
|
164
|
-
:TTF_FontLineSkip => :TTF_FontLineSkip,
|
165
|
-
:TTF_GetFontKerning => :TTF_GetFontKerning,
|
166
|
-
:TTF_SetFontKerning => :TTF_SetFontKerning,
|
167
|
-
:TTF_FontFaces => :TTF_FontFaces,
|
168
|
-
:TTF_FontFaceIsFixedWidth => :TTF_FontFaceIsFixedWidth,
|
169
|
-
:TTF_FontFaceFamilyName => :TTF_FontFaceFamilyName,
|
170
|
-
:TTF_FontFaceStyleName => :TTF_FontFaceStyleName,
|
171
|
-
:TTF_GlyphIsProvided => :TTF_GlyphIsProvided,
|
172
|
-
:TTF_GlyphIsProvided32 => :TTF_GlyphIsProvided32,
|
173
|
-
:TTF_GlyphMetrics => :TTF_GlyphMetrics,
|
174
|
-
:TTF_GlyphMetrics32 => :TTF_GlyphMetrics32,
|
175
|
-
:TTF_SizeText => :TTF_SizeText,
|
176
|
-
:TTF_SizeUTF8 => :TTF_SizeUTF8,
|
177
|
-
:TTF_SizeUNICODE => :TTF_SizeUNICODE,
|
178
|
-
:TTF_MeasureText => :TTF_MeasureText,
|
179
|
-
:TTF_MeasureUTF8 => :TTF_MeasureUTF8,
|
180
|
-
:TTF_MeasureUNICODE => :TTF_MeasureUNICODE,
|
181
|
-
:TTF_RenderText_Solid => :TTF_RenderText_Solid,
|
182
|
-
:TTF_RenderUTF8_Solid => :TTF_RenderUTF8_Solid,
|
183
|
-
:TTF_RenderUNICODE_Solid => :TTF_RenderUNICODE_Solid,
|
184
|
-
:TTF_RenderText_Solid_Wrapped => :TTF_RenderText_Solid_Wrapped,
|
185
|
-
:TTF_RenderUTF8_Solid_Wrapped => :TTF_RenderUTF8_Solid_Wrapped,
|
186
|
-
:TTF_RenderUNICODE_Solid_Wrapped => :TTF_RenderUNICODE_Solid_Wrapped,
|
187
|
-
:TTF_RenderGlyph_Solid => :TTF_RenderGlyph_Solid,
|
188
|
-
:TTF_RenderGlyph32_Solid => :TTF_RenderGlyph32_Solid,
|
189
|
-
:TTF_RenderText_Shaded => :TTF_RenderText_Shaded,
|
190
|
-
:TTF_RenderUTF8_Shaded => :TTF_RenderUTF8_Shaded,
|
191
|
-
:TTF_RenderUNICODE_Shaded => :TTF_RenderUNICODE_Shaded,
|
192
|
-
:TTF_RenderText_Shaded_Wrapped => :TTF_RenderText_Shaded_Wrapped,
|
193
|
-
:TTF_RenderUTF8_Shaded_Wrapped => :TTF_RenderUTF8_Shaded_Wrapped,
|
194
|
-
:TTF_RenderUNICODE_Shaded_Wrapped => :TTF_RenderUNICODE_Shaded_Wrapped,
|
195
|
-
:TTF_RenderGlyph_Shaded => :TTF_RenderGlyph_Shaded,
|
196
|
-
:TTF_RenderGlyph32_Shaded => :TTF_RenderGlyph32_Shaded,
|
197
|
-
:TTF_RenderText_Blended => :TTF_RenderText_Blended,
|
198
|
-
:TTF_RenderUTF8_Blended => :TTF_RenderUTF8_Blended,
|
199
|
-
:TTF_RenderUNICODE_Blended => :TTF_RenderUNICODE_Blended,
|
200
|
-
:TTF_RenderText_Blended_Wrapped => :TTF_RenderText_Blended_Wrapped,
|
201
|
-
:TTF_RenderUTF8_Blended_Wrapped => :TTF_RenderUTF8_Blended_Wrapped,
|
202
|
-
:TTF_RenderUNICODE_Blended_Wrapped => :TTF_RenderUNICODE_Blended_Wrapped,
|
203
|
-
:TTF_RenderGlyph_Blended => :TTF_RenderGlyph_Blended,
|
204
|
-
:TTF_RenderGlyph32_Blended => :TTF_RenderGlyph32_Blended,
|
205
|
-
:TTF_RenderText_LCD => :TTF_RenderText_LCD,
|
206
|
-
:TTF_RenderUTF8_LCD => :TTF_RenderUTF8_LCD,
|
207
|
-
:TTF_RenderUNICODE_LCD => :TTF_RenderUNICODE_LCD,
|
208
|
-
:TTF_RenderText_LCD_Wrapped => :TTF_RenderText_LCD_Wrapped,
|
209
|
-
:TTF_RenderUTF8_LCD_Wrapped => :TTF_RenderUTF8_LCD_Wrapped,
|
210
|
-
:TTF_RenderUNICODE_LCD_Wrapped => :TTF_RenderUNICODE_LCD_Wrapped,
|
211
|
-
:TTF_RenderGlyph_LCD => :TTF_RenderGlyph_LCD,
|
212
|
-
:TTF_RenderGlyph32_LCD => :TTF_RenderGlyph32_LCD,
|
213
|
-
:TTF_CloseFont => :TTF_CloseFont,
|
214
|
-
:TTF_Quit => :TTF_Quit,
|
215
|
-
:TTF_WasInit => :TTF_WasInit,
|
216
|
-
:TTF_GetFontKerningSize => :TTF_GetFontKerningSize,
|
217
|
-
:TTF_GetFontKerningSizeGlyphs => :TTF_GetFontKerningSizeGlyphs,
|
218
|
-
:TTF_GetFontKerningSizeGlyphs32 => :TTF_GetFontKerningSizeGlyphs32,
|
219
|
-
:TTF_SetFontSDF => :TTF_SetFontSDF,
|
220
|
-
:TTF_GetFontSDF => :TTF_GetFontSDF,
|
221
|
-
:TTF_SetDirection => :TTF_SetDirection,
|
222
|
-
:TTF_SetScript => :TTF_SetScript,
|
223
|
-
:TTF_SetFontDirection => :TTF_SetFontDirection,
|
224
|
-
:TTF_SetFontScriptName => :TTF_SetFontScriptName,
|
225
|
-
}
|
226
|
-
args = {
|
227
|
-
:TTF_Linked_Version => [],
|
228
|
-
:TTF_GetFreeTypeVersion => [:pointer, :pointer, :pointer],
|
229
|
-
:TTF_GetHarfBuzzVersion => [:pointer, :pointer, :pointer],
|
230
|
-
:TTF_ByteSwappedUNICODE => [:int],
|
231
|
-
:TTF_Init => [],
|
232
|
-
:TTF_OpenFont => [:pointer, :int],
|
233
|
-
:TTF_OpenFontIndex => [:pointer, :int, :long],
|
234
|
-
:TTF_OpenFontRW => [:pointer, :int, :int],
|
235
|
-
:TTF_OpenFontIndexRW => [:pointer, :int, :int, :long],
|
236
|
-
:TTF_OpenFontDPI => [:pointer, :int, :uint, :uint],
|
237
|
-
:TTF_OpenFontIndexDPI => [:pointer, :int, :long, :uint, :uint],
|
238
|
-
:TTF_OpenFontDPIRW => [:pointer, :int, :int, :uint, :uint],
|
239
|
-
:TTF_OpenFontIndexDPIRW => [:pointer, :int, :int, :long, :uint, :uint],
|
240
|
-
:TTF_SetFontSize => [:pointer, :int],
|
241
|
-
:TTF_SetFontSizeDPI => [:pointer, :int, :uint, :uint],
|
242
|
-
:TTF_GetFontStyle => [:pointer],
|
243
|
-
:TTF_SetFontStyle => [:pointer, :int],
|
244
|
-
:TTF_GetFontOutline => [:pointer],
|
245
|
-
:TTF_SetFontOutline => [:pointer, :int],
|
246
|
-
:TTF_GetFontHinting => [:pointer],
|
247
|
-
:TTF_SetFontHinting => [:pointer, :int],
|
248
|
-
:TTF_GetFontWrappedAlign => [:pointer],
|
249
|
-
:TTF_SetFontWrappedAlign => [:pointer, :int],
|
250
|
-
:TTF_FontHeight => [:pointer],
|
251
|
-
:TTF_FontAscent => [:pointer],
|
252
|
-
:TTF_FontDescent => [:pointer],
|
253
|
-
:TTF_FontLineSkip => [:pointer],
|
254
|
-
:TTF_GetFontKerning => [:pointer],
|
255
|
-
:TTF_SetFontKerning => [:pointer, :int],
|
256
|
-
:TTF_FontFaces => [:pointer],
|
257
|
-
:TTF_FontFaceIsFixedWidth => [:pointer],
|
258
|
-
:TTF_FontFaceFamilyName => [:pointer],
|
259
|
-
:TTF_FontFaceStyleName => [:pointer],
|
260
|
-
:TTF_GlyphIsProvided => [:pointer, :ushort],
|
261
|
-
:TTF_GlyphIsProvided32 => [:pointer, :uint],
|
262
|
-
:TTF_GlyphMetrics => [:pointer, :ushort, :pointer, :pointer, :pointer, :pointer, :pointer],
|
263
|
-
:TTF_GlyphMetrics32 => [:pointer, :uint, :pointer, :pointer, :pointer, :pointer, :pointer],
|
264
|
-
:TTF_SizeText => [:pointer, :pointer, :pointer, :pointer],
|
265
|
-
:TTF_SizeUTF8 => [:pointer, :pointer, :pointer, :pointer],
|
266
|
-
:TTF_SizeUNICODE => [:pointer, :pointer, :pointer, :pointer],
|
267
|
-
:TTF_MeasureText => [:pointer, :pointer, :int, :pointer, :pointer],
|
268
|
-
:TTF_MeasureUTF8 => [:pointer, :pointer, :int, :pointer, :pointer],
|
269
|
-
:TTF_MeasureUNICODE => [:pointer, :pointer, :int, :pointer, :pointer],
|
270
|
-
:TTF_RenderText_Solid => [:pointer, :pointer, Color.by_value],
|
271
|
-
:TTF_RenderUTF8_Solid => [:pointer, :pointer, Color.by_value],
|
272
|
-
:TTF_RenderUNICODE_Solid => [:pointer, :pointer, Color.by_value],
|
273
|
-
:TTF_RenderText_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
274
|
-
:TTF_RenderUTF8_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
275
|
-
:TTF_RenderUNICODE_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
276
|
-
:TTF_RenderGlyph_Solid => [:pointer, :ushort, Color.by_value],
|
277
|
-
:TTF_RenderGlyph32_Solid => [:pointer, :uint, Color.by_value],
|
278
|
-
:TTF_RenderText_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
279
|
-
:TTF_RenderUTF8_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
280
|
-
:TTF_RenderUNICODE_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
281
|
-
:TTF_RenderText_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
282
|
-
:TTF_RenderUTF8_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
283
|
-
:TTF_RenderUNICODE_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
284
|
-
:TTF_RenderGlyph_Shaded => [:pointer, :ushort, Color.by_value, Color.by_value],
|
285
|
-
:TTF_RenderGlyph32_Shaded => [:pointer, :uint, Color.by_value, Color.by_value],
|
286
|
-
:TTF_RenderText_Blended => [:pointer, :pointer, Color.by_value],
|
287
|
-
:TTF_RenderUTF8_Blended => [:pointer, :pointer, Color.by_value],
|
288
|
-
:TTF_RenderUNICODE_Blended => [:pointer, :pointer, Color.by_value],
|
289
|
-
:TTF_RenderText_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
290
|
-
:TTF_RenderUTF8_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
291
|
-
:TTF_RenderUNICODE_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
292
|
-
:TTF_RenderGlyph_Blended => [:pointer, :ushort, Color.by_value],
|
293
|
-
:TTF_RenderGlyph32_Blended => [:pointer, :uint, Color.by_value],
|
294
|
-
:TTF_RenderText_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
295
|
-
:TTF_RenderUTF8_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
296
|
-
:TTF_RenderUNICODE_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
297
|
-
:TTF_RenderText_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
298
|
-
:TTF_RenderUTF8_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
299
|
-
:TTF_RenderUNICODE_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
300
|
-
:TTF_RenderGlyph_LCD => [:pointer, :ushort, Color.by_value, Color.by_value],
|
301
|
-
:TTF_RenderGlyph32_LCD => [:pointer, :uint, Color.by_value, Color.by_value],
|
302
|
-
:TTF_CloseFont => [:pointer],
|
303
|
-
:TTF_Quit => [],
|
304
|
-
:TTF_WasInit => [],
|
305
|
-
:TTF_GetFontKerningSize => [:pointer, :int, :int],
|
306
|
-
:TTF_GetFontKerningSizeGlyphs => [:pointer, :ushort, :ushort],
|
307
|
-
:TTF_GetFontKerningSizeGlyphs32 => [:pointer, :uint, :uint],
|
308
|
-
:TTF_SetFontSDF => [:pointer, :int],
|
309
|
-
:TTF_GetFontSDF => [:pointer],
|
310
|
-
:TTF_SetDirection => [:int],
|
311
|
-
:TTF_SetScript => [:int],
|
312
|
-
:TTF_SetFontDirection => [:pointer, :int],
|
313
|
-
:TTF_SetFontScriptName => [:pointer, :pointer],
|
314
|
-
}
|
315
|
-
retvals = {
|
316
|
-
:TTF_Linked_Version => :pointer,
|
317
|
-
:TTF_GetFreeTypeVersion => :void,
|
318
|
-
:TTF_GetHarfBuzzVersion => :void,
|
319
|
-
:TTF_ByteSwappedUNICODE => :void,
|
320
|
-
:TTF_Init => :int,
|
321
|
-
:TTF_OpenFont => :pointer,
|
322
|
-
:TTF_OpenFontIndex => :pointer,
|
323
|
-
:TTF_OpenFontRW => :pointer,
|
324
|
-
:TTF_OpenFontIndexRW => :pointer,
|
325
|
-
:TTF_OpenFontDPI => :pointer,
|
326
|
-
:TTF_OpenFontIndexDPI => :pointer,
|
327
|
-
:TTF_OpenFontDPIRW => :pointer,
|
328
|
-
:TTF_OpenFontIndexDPIRW => :pointer,
|
329
|
-
:TTF_SetFontSize => :int,
|
330
|
-
:TTF_SetFontSizeDPI => :int,
|
331
|
-
:TTF_GetFontStyle => :int,
|
332
|
-
:TTF_SetFontStyle => :void,
|
333
|
-
:TTF_GetFontOutline => :int,
|
334
|
-
:TTF_SetFontOutline => :void,
|
335
|
-
:TTF_GetFontHinting => :int,
|
336
|
-
:TTF_SetFontHinting => :void,
|
337
|
-
:TTF_GetFontWrappedAlign => :int,
|
338
|
-
:TTF_SetFontWrappedAlign => :void,
|
339
|
-
:TTF_FontHeight => :int,
|
340
|
-
:TTF_FontAscent => :int,
|
341
|
-
:TTF_FontDescent => :int,
|
342
|
-
:TTF_FontLineSkip => :int,
|
343
|
-
:TTF_GetFontKerning => :int,
|
344
|
-
:TTF_SetFontKerning => :void,
|
345
|
-
:TTF_FontFaces => :long,
|
346
|
-
:TTF_FontFaceIsFixedWidth => :int,
|
347
|
-
:TTF_FontFaceFamilyName => :pointer,
|
348
|
-
:TTF_FontFaceStyleName => :pointer,
|
349
|
-
:TTF_GlyphIsProvided => :int,
|
350
|
-
:TTF_GlyphIsProvided32 => :int,
|
351
|
-
:TTF_GlyphMetrics => :int,
|
352
|
-
:TTF_GlyphMetrics32 => :int,
|
353
|
-
:TTF_SizeText => :int,
|
354
|
-
:TTF_SizeUTF8 => :int,
|
355
|
-
:TTF_SizeUNICODE => :int,
|
356
|
-
:TTF_MeasureText => :int,
|
357
|
-
:TTF_MeasureUTF8 => :int,
|
358
|
-
:TTF_MeasureUNICODE => :int,
|
359
|
-
:TTF_RenderText_Solid => :pointer,
|
360
|
-
:TTF_RenderUTF8_Solid => :pointer,
|
361
|
-
:TTF_RenderUNICODE_Solid => :pointer,
|
362
|
-
:TTF_RenderText_Solid_Wrapped => :pointer,
|
363
|
-
:TTF_RenderUTF8_Solid_Wrapped => :pointer,
|
364
|
-
:TTF_RenderUNICODE_Solid_Wrapped => :pointer,
|
365
|
-
:TTF_RenderGlyph_Solid => :pointer,
|
366
|
-
:TTF_RenderGlyph32_Solid => :pointer,
|
367
|
-
:TTF_RenderText_Shaded => :pointer,
|
368
|
-
:TTF_RenderUTF8_Shaded => :pointer,
|
369
|
-
:TTF_RenderUNICODE_Shaded => :pointer,
|
370
|
-
:TTF_RenderText_Shaded_Wrapped => :pointer,
|
371
|
-
:TTF_RenderUTF8_Shaded_Wrapped => :pointer,
|
372
|
-
:TTF_RenderUNICODE_Shaded_Wrapped => :pointer,
|
373
|
-
:TTF_RenderGlyph_Shaded => :pointer,
|
374
|
-
:TTF_RenderGlyph32_Shaded => :pointer,
|
375
|
-
:TTF_RenderText_Blended => :pointer,
|
376
|
-
:TTF_RenderUTF8_Blended => :pointer,
|
377
|
-
:TTF_RenderUNICODE_Blended => :pointer,
|
378
|
-
:TTF_RenderText_Blended_Wrapped => :pointer,
|
379
|
-
:TTF_RenderUTF8_Blended_Wrapped => :pointer,
|
380
|
-
:TTF_RenderUNICODE_Blended_Wrapped => :pointer,
|
381
|
-
:TTF_RenderGlyph_Blended => :pointer,
|
382
|
-
:TTF_RenderGlyph32_Blended => :pointer,
|
383
|
-
:TTF_RenderText_LCD => :pointer,
|
384
|
-
:TTF_RenderUTF8_LCD => :pointer,
|
385
|
-
:TTF_RenderUNICODE_LCD => :pointer,
|
386
|
-
:TTF_RenderText_LCD_Wrapped => :pointer,
|
387
|
-
:TTF_RenderUTF8_LCD_Wrapped => :pointer,
|
388
|
-
:TTF_RenderUNICODE_LCD_Wrapped => :pointer,
|
389
|
-
:TTF_RenderGlyph_LCD => :pointer,
|
390
|
-
:TTF_RenderGlyph32_LCD => :pointer,
|
391
|
-
:TTF_CloseFont => :void,
|
392
|
-
:TTF_Quit => :void,
|
393
|
-
:TTF_WasInit => :int,
|
394
|
-
:TTF_GetFontKerningSize => :int,
|
395
|
-
:TTF_GetFontKerningSizeGlyphs => :int,
|
396
|
-
:TTF_GetFontKerningSizeGlyphs32 => :int,
|
397
|
-
:TTF_SetFontSDF => :int,
|
398
|
-
:TTF_GetFontSDF => :int,
|
399
|
-
:TTF_SetDirection => :int,
|
400
|
-
:TTF_SetScript => :int,
|
401
|
-
:TTF_SetFontDirection => :int,
|
402
|
-
:TTF_SetFontScriptName => :int,
|
403
|
-
}
|
404
|
-
symbols.each do |sym|
|
405
|
-
begin
|
406
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
407
|
-
rescue FFI::NotFoundError => error
|
408
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
409
|
-
end
|
410
|
-
end
|
411
|
-
end
|
412
|
-
|
413
|
-
end
|
414
|
-
|
1
|
+
# Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/sdl2-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] This is an automatically generated file.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
require_relative 'sdl2_pixels'
|
9
|
+
|
10
|
+
module SDL
|
11
|
+
extend FFI::Library
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
TTF_MAJOR_VERSION = 2
|
15
|
+
TTF_MINOR_VERSION = 20
|
16
|
+
TTF_PATCHLEVEL = 1
|
17
|
+
TTF_STYLE_NORMAL = 0x00
|
18
|
+
TTF_STYLE_BOLD = 0x01
|
19
|
+
TTF_STYLE_ITALIC = 0x02
|
20
|
+
TTF_STYLE_UNDERLINE = 0x04
|
21
|
+
TTF_STYLE_STRIKETHROUGH = 0x08
|
22
|
+
TTF_HINTING_NORMAL = 0
|
23
|
+
TTF_HINTING_LIGHT = 1
|
24
|
+
TTF_HINTING_MONO = 2
|
25
|
+
TTF_HINTING_NONE = 3
|
26
|
+
TTF_HINTING_LIGHT_SUBPIXEL = 4
|
27
|
+
TTF_WRAPPED_ALIGN_LEFT = 0
|
28
|
+
TTF_WRAPPED_ALIGN_CENTER = 1
|
29
|
+
TTF_WRAPPED_ALIGN_RIGHT = 2
|
30
|
+
|
31
|
+
# Enum
|
32
|
+
|
33
|
+
TTF_DIRECTION_LTR = 0
|
34
|
+
TTF_DIRECTION_RTL = 1
|
35
|
+
TTF_DIRECTION_TTB = 2
|
36
|
+
TTF_DIRECTION_BTT = 3
|
37
|
+
|
38
|
+
# Typedef
|
39
|
+
|
40
|
+
typedef :int, :TTF_Direction
|
41
|
+
|
42
|
+
# Struct
|
43
|
+
|
44
|
+
|
45
|
+
# Function
|
46
|
+
|
47
|
+
def self.setup_ttf_symbols(output_error = false)
|
48
|
+
symbols = [
|
49
|
+
:TTF_Linked_Version,
|
50
|
+
:TTF_GetFreeTypeVersion,
|
51
|
+
:TTF_GetHarfBuzzVersion,
|
52
|
+
:TTF_ByteSwappedUNICODE,
|
53
|
+
:TTF_Init,
|
54
|
+
:TTF_OpenFont,
|
55
|
+
:TTF_OpenFontIndex,
|
56
|
+
:TTF_OpenFontRW,
|
57
|
+
:TTF_OpenFontIndexRW,
|
58
|
+
:TTF_OpenFontDPI,
|
59
|
+
:TTF_OpenFontIndexDPI,
|
60
|
+
:TTF_OpenFontDPIRW,
|
61
|
+
:TTF_OpenFontIndexDPIRW,
|
62
|
+
:TTF_SetFontSize,
|
63
|
+
:TTF_SetFontSizeDPI,
|
64
|
+
:TTF_GetFontStyle,
|
65
|
+
:TTF_SetFontStyle,
|
66
|
+
:TTF_GetFontOutline,
|
67
|
+
:TTF_SetFontOutline,
|
68
|
+
:TTF_GetFontHinting,
|
69
|
+
:TTF_SetFontHinting,
|
70
|
+
:TTF_GetFontWrappedAlign,
|
71
|
+
:TTF_SetFontWrappedAlign,
|
72
|
+
:TTF_FontHeight,
|
73
|
+
:TTF_FontAscent,
|
74
|
+
:TTF_FontDescent,
|
75
|
+
:TTF_FontLineSkip,
|
76
|
+
:TTF_GetFontKerning,
|
77
|
+
:TTF_SetFontKerning,
|
78
|
+
:TTF_FontFaces,
|
79
|
+
:TTF_FontFaceIsFixedWidth,
|
80
|
+
:TTF_FontFaceFamilyName,
|
81
|
+
:TTF_FontFaceStyleName,
|
82
|
+
:TTF_GlyphIsProvided,
|
83
|
+
:TTF_GlyphIsProvided32,
|
84
|
+
:TTF_GlyphMetrics,
|
85
|
+
:TTF_GlyphMetrics32,
|
86
|
+
:TTF_SizeText,
|
87
|
+
:TTF_SizeUTF8,
|
88
|
+
:TTF_SizeUNICODE,
|
89
|
+
:TTF_MeasureText,
|
90
|
+
:TTF_MeasureUTF8,
|
91
|
+
:TTF_MeasureUNICODE,
|
92
|
+
:TTF_RenderText_Solid,
|
93
|
+
:TTF_RenderUTF8_Solid,
|
94
|
+
:TTF_RenderUNICODE_Solid,
|
95
|
+
:TTF_RenderText_Solid_Wrapped,
|
96
|
+
:TTF_RenderUTF8_Solid_Wrapped,
|
97
|
+
:TTF_RenderUNICODE_Solid_Wrapped,
|
98
|
+
:TTF_RenderGlyph_Solid,
|
99
|
+
:TTF_RenderGlyph32_Solid,
|
100
|
+
:TTF_RenderText_Shaded,
|
101
|
+
:TTF_RenderUTF8_Shaded,
|
102
|
+
:TTF_RenderUNICODE_Shaded,
|
103
|
+
:TTF_RenderText_Shaded_Wrapped,
|
104
|
+
:TTF_RenderUTF8_Shaded_Wrapped,
|
105
|
+
:TTF_RenderUNICODE_Shaded_Wrapped,
|
106
|
+
:TTF_RenderGlyph_Shaded,
|
107
|
+
:TTF_RenderGlyph32_Shaded,
|
108
|
+
:TTF_RenderText_Blended,
|
109
|
+
:TTF_RenderUTF8_Blended,
|
110
|
+
:TTF_RenderUNICODE_Blended,
|
111
|
+
:TTF_RenderText_Blended_Wrapped,
|
112
|
+
:TTF_RenderUTF8_Blended_Wrapped,
|
113
|
+
:TTF_RenderUNICODE_Blended_Wrapped,
|
114
|
+
:TTF_RenderGlyph_Blended,
|
115
|
+
:TTF_RenderGlyph32_Blended,
|
116
|
+
:TTF_RenderText_LCD,
|
117
|
+
:TTF_RenderUTF8_LCD,
|
118
|
+
:TTF_RenderUNICODE_LCD,
|
119
|
+
:TTF_RenderText_LCD_Wrapped,
|
120
|
+
:TTF_RenderUTF8_LCD_Wrapped,
|
121
|
+
:TTF_RenderUNICODE_LCD_Wrapped,
|
122
|
+
:TTF_RenderGlyph_LCD,
|
123
|
+
:TTF_RenderGlyph32_LCD,
|
124
|
+
:TTF_CloseFont,
|
125
|
+
:TTF_Quit,
|
126
|
+
:TTF_WasInit,
|
127
|
+
:TTF_GetFontKerningSize,
|
128
|
+
:TTF_GetFontKerningSizeGlyphs,
|
129
|
+
:TTF_GetFontKerningSizeGlyphs32,
|
130
|
+
:TTF_SetFontSDF,
|
131
|
+
:TTF_GetFontSDF,
|
132
|
+
:TTF_SetDirection,
|
133
|
+
:TTF_SetScript,
|
134
|
+
:TTF_SetFontDirection,
|
135
|
+
:TTF_SetFontScriptName,
|
136
|
+
]
|
137
|
+
apis = {
|
138
|
+
:TTF_Linked_Version => :TTF_Linked_Version,
|
139
|
+
:TTF_GetFreeTypeVersion => :TTF_GetFreeTypeVersion,
|
140
|
+
:TTF_GetHarfBuzzVersion => :TTF_GetHarfBuzzVersion,
|
141
|
+
:TTF_ByteSwappedUNICODE => :TTF_ByteSwappedUNICODE,
|
142
|
+
:TTF_Init => :TTF_Init,
|
143
|
+
:TTF_OpenFont => :TTF_OpenFont,
|
144
|
+
:TTF_OpenFontIndex => :TTF_OpenFontIndex,
|
145
|
+
:TTF_OpenFontRW => :TTF_OpenFontRW,
|
146
|
+
:TTF_OpenFontIndexRW => :TTF_OpenFontIndexRW,
|
147
|
+
:TTF_OpenFontDPI => :TTF_OpenFontDPI,
|
148
|
+
:TTF_OpenFontIndexDPI => :TTF_OpenFontIndexDPI,
|
149
|
+
:TTF_OpenFontDPIRW => :TTF_OpenFontDPIRW,
|
150
|
+
:TTF_OpenFontIndexDPIRW => :TTF_OpenFontIndexDPIRW,
|
151
|
+
:TTF_SetFontSize => :TTF_SetFontSize,
|
152
|
+
:TTF_SetFontSizeDPI => :TTF_SetFontSizeDPI,
|
153
|
+
:TTF_GetFontStyle => :TTF_GetFontStyle,
|
154
|
+
:TTF_SetFontStyle => :TTF_SetFontStyle,
|
155
|
+
:TTF_GetFontOutline => :TTF_GetFontOutline,
|
156
|
+
:TTF_SetFontOutline => :TTF_SetFontOutline,
|
157
|
+
:TTF_GetFontHinting => :TTF_GetFontHinting,
|
158
|
+
:TTF_SetFontHinting => :TTF_SetFontHinting,
|
159
|
+
:TTF_GetFontWrappedAlign => :TTF_GetFontWrappedAlign,
|
160
|
+
:TTF_SetFontWrappedAlign => :TTF_SetFontWrappedAlign,
|
161
|
+
:TTF_FontHeight => :TTF_FontHeight,
|
162
|
+
:TTF_FontAscent => :TTF_FontAscent,
|
163
|
+
:TTF_FontDescent => :TTF_FontDescent,
|
164
|
+
:TTF_FontLineSkip => :TTF_FontLineSkip,
|
165
|
+
:TTF_GetFontKerning => :TTF_GetFontKerning,
|
166
|
+
:TTF_SetFontKerning => :TTF_SetFontKerning,
|
167
|
+
:TTF_FontFaces => :TTF_FontFaces,
|
168
|
+
:TTF_FontFaceIsFixedWidth => :TTF_FontFaceIsFixedWidth,
|
169
|
+
:TTF_FontFaceFamilyName => :TTF_FontFaceFamilyName,
|
170
|
+
:TTF_FontFaceStyleName => :TTF_FontFaceStyleName,
|
171
|
+
:TTF_GlyphIsProvided => :TTF_GlyphIsProvided,
|
172
|
+
:TTF_GlyphIsProvided32 => :TTF_GlyphIsProvided32,
|
173
|
+
:TTF_GlyphMetrics => :TTF_GlyphMetrics,
|
174
|
+
:TTF_GlyphMetrics32 => :TTF_GlyphMetrics32,
|
175
|
+
:TTF_SizeText => :TTF_SizeText,
|
176
|
+
:TTF_SizeUTF8 => :TTF_SizeUTF8,
|
177
|
+
:TTF_SizeUNICODE => :TTF_SizeUNICODE,
|
178
|
+
:TTF_MeasureText => :TTF_MeasureText,
|
179
|
+
:TTF_MeasureUTF8 => :TTF_MeasureUTF8,
|
180
|
+
:TTF_MeasureUNICODE => :TTF_MeasureUNICODE,
|
181
|
+
:TTF_RenderText_Solid => :TTF_RenderText_Solid,
|
182
|
+
:TTF_RenderUTF8_Solid => :TTF_RenderUTF8_Solid,
|
183
|
+
:TTF_RenderUNICODE_Solid => :TTF_RenderUNICODE_Solid,
|
184
|
+
:TTF_RenderText_Solid_Wrapped => :TTF_RenderText_Solid_Wrapped,
|
185
|
+
:TTF_RenderUTF8_Solid_Wrapped => :TTF_RenderUTF8_Solid_Wrapped,
|
186
|
+
:TTF_RenderUNICODE_Solid_Wrapped => :TTF_RenderUNICODE_Solid_Wrapped,
|
187
|
+
:TTF_RenderGlyph_Solid => :TTF_RenderGlyph_Solid,
|
188
|
+
:TTF_RenderGlyph32_Solid => :TTF_RenderGlyph32_Solid,
|
189
|
+
:TTF_RenderText_Shaded => :TTF_RenderText_Shaded,
|
190
|
+
:TTF_RenderUTF8_Shaded => :TTF_RenderUTF8_Shaded,
|
191
|
+
:TTF_RenderUNICODE_Shaded => :TTF_RenderUNICODE_Shaded,
|
192
|
+
:TTF_RenderText_Shaded_Wrapped => :TTF_RenderText_Shaded_Wrapped,
|
193
|
+
:TTF_RenderUTF8_Shaded_Wrapped => :TTF_RenderUTF8_Shaded_Wrapped,
|
194
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => :TTF_RenderUNICODE_Shaded_Wrapped,
|
195
|
+
:TTF_RenderGlyph_Shaded => :TTF_RenderGlyph_Shaded,
|
196
|
+
:TTF_RenderGlyph32_Shaded => :TTF_RenderGlyph32_Shaded,
|
197
|
+
:TTF_RenderText_Blended => :TTF_RenderText_Blended,
|
198
|
+
:TTF_RenderUTF8_Blended => :TTF_RenderUTF8_Blended,
|
199
|
+
:TTF_RenderUNICODE_Blended => :TTF_RenderUNICODE_Blended,
|
200
|
+
:TTF_RenderText_Blended_Wrapped => :TTF_RenderText_Blended_Wrapped,
|
201
|
+
:TTF_RenderUTF8_Blended_Wrapped => :TTF_RenderUTF8_Blended_Wrapped,
|
202
|
+
:TTF_RenderUNICODE_Blended_Wrapped => :TTF_RenderUNICODE_Blended_Wrapped,
|
203
|
+
:TTF_RenderGlyph_Blended => :TTF_RenderGlyph_Blended,
|
204
|
+
:TTF_RenderGlyph32_Blended => :TTF_RenderGlyph32_Blended,
|
205
|
+
:TTF_RenderText_LCD => :TTF_RenderText_LCD,
|
206
|
+
:TTF_RenderUTF8_LCD => :TTF_RenderUTF8_LCD,
|
207
|
+
:TTF_RenderUNICODE_LCD => :TTF_RenderUNICODE_LCD,
|
208
|
+
:TTF_RenderText_LCD_Wrapped => :TTF_RenderText_LCD_Wrapped,
|
209
|
+
:TTF_RenderUTF8_LCD_Wrapped => :TTF_RenderUTF8_LCD_Wrapped,
|
210
|
+
:TTF_RenderUNICODE_LCD_Wrapped => :TTF_RenderUNICODE_LCD_Wrapped,
|
211
|
+
:TTF_RenderGlyph_LCD => :TTF_RenderGlyph_LCD,
|
212
|
+
:TTF_RenderGlyph32_LCD => :TTF_RenderGlyph32_LCD,
|
213
|
+
:TTF_CloseFont => :TTF_CloseFont,
|
214
|
+
:TTF_Quit => :TTF_Quit,
|
215
|
+
:TTF_WasInit => :TTF_WasInit,
|
216
|
+
:TTF_GetFontKerningSize => :TTF_GetFontKerningSize,
|
217
|
+
:TTF_GetFontKerningSizeGlyphs => :TTF_GetFontKerningSizeGlyphs,
|
218
|
+
:TTF_GetFontKerningSizeGlyphs32 => :TTF_GetFontKerningSizeGlyphs32,
|
219
|
+
:TTF_SetFontSDF => :TTF_SetFontSDF,
|
220
|
+
:TTF_GetFontSDF => :TTF_GetFontSDF,
|
221
|
+
:TTF_SetDirection => :TTF_SetDirection,
|
222
|
+
:TTF_SetScript => :TTF_SetScript,
|
223
|
+
:TTF_SetFontDirection => :TTF_SetFontDirection,
|
224
|
+
:TTF_SetFontScriptName => :TTF_SetFontScriptName,
|
225
|
+
}
|
226
|
+
args = {
|
227
|
+
:TTF_Linked_Version => [],
|
228
|
+
:TTF_GetFreeTypeVersion => [:pointer, :pointer, :pointer],
|
229
|
+
:TTF_GetHarfBuzzVersion => [:pointer, :pointer, :pointer],
|
230
|
+
:TTF_ByteSwappedUNICODE => [:int],
|
231
|
+
:TTF_Init => [],
|
232
|
+
:TTF_OpenFont => [:pointer, :int],
|
233
|
+
:TTF_OpenFontIndex => [:pointer, :int, :long],
|
234
|
+
:TTF_OpenFontRW => [:pointer, :int, :int],
|
235
|
+
:TTF_OpenFontIndexRW => [:pointer, :int, :int, :long],
|
236
|
+
:TTF_OpenFontDPI => [:pointer, :int, :uint, :uint],
|
237
|
+
:TTF_OpenFontIndexDPI => [:pointer, :int, :long, :uint, :uint],
|
238
|
+
:TTF_OpenFontDPIRW => [:pointer, :int, :int, :uint, :uint],
|
239
|
+
:TTF_OpenFontIndexDPIRW => [:pointer, :int, :int, :long, :uint, :uint],
|
240
|
+
:TTF_SetFontSize => [:pointer, :int],
|
241
|
+
:TTF_SetFontSizeDPI => [:pointer, :int, :uint, :uint],
|
242
|
+
:TTF_GetFontStyle => [:pointer],
|
243
|
+
:TTF_SetFontStyle => [:pointer, :int],
|
244
|
+
:TTF_GetFontOutline => [:pointer],
|
245
|
+
:TTF_SetFontOutline => [:pointer, :int],
|
246
|
+
:TTF_GetFontHinting => [:pointer],
|
247
|
+
:TTF_SetFontHinting => [:pointer, :int],
|
248
|
+
:TTF_GetFontWrappedAlign => [:pointer],
|
249
|
+
:TTF_SetFontWrappedAlign => [:pointer, :int],
|
250
|
+
:TTF_FontHeight => [:pointer],
|
251
|
+
:TTF_FontAscent => [:pointer],
|
252
|
+
:TTF_FontDescent => [:pointer],
|
253
|
+
:TTF_FontLineSkip => [:pointer],
|
254
|
+
:TTF_GetFontKerning => [:pointer],
|
255
|
+
:TTF_SetFontKerning => [:pointer, :int],
|
256
|
+
:TTF_FontFaces => [:pointer],
|
257
|
+
:TTF_FontFaceIsFixedWidth => [:pointer],
|
258
|
+
:TTF_FontFaceFamilyName => [:pointer],
|
259
|
+
:TTF_FontFaceStyleName => [:pointer],
|
260
|
+
:TTF_GlyphIsProvided => [:pointer, :ushort],
|
261
|
+
:TTF_GlyphIsProvided32 => [:pointer, :uint],
|
262
|
+
:TTF_GlyphMetrics => [:pointer, :ushort, :pointer, :pointer, :pointer, :pointer, :pointer],
|
263
|
+
:TTF_GlyphMetrics32 => [:pointer, :uint, :pointer, :pointer, :pointer, :pointer, :pointer],
|
264
|
+
:TTF_SizeText => [:pointer, :pointer, :pointer, :pointer],
|
265
|
+
:TTF_SizeUTF8 => [:pointer, :pointer, :pointer, :pointer],
|
266
|
+
:TTF_SizeUNICODE => [:pointer, :pointer, :pointer, :pointer],
|
267
|
+
:TTF_MeasureText => [:pointer, :pointer, :int, :pointer, :pointer],
|
268
|
+
:TTF_MeasureUTF8 => [:pointer, :pointer, :int, :pointer, :pointer],
|
269
|
+
:TTF_MeasureUNICODE => [:pointer, :pointer, :int, :pointer, :pointer],
|
270
|
+
:TTF_RenderText_Solid => [:pointer, :pointer, Color.by_value],
|
271
|
+
:TTF_RenderUTF8_Solid => [:pointer, :pointer, Color.by_value],
|
272
|
+
:TTF_RenderUNICODE_Solid => [:pointer, :pointer, Color.by_value],
|
273
|
+
:TTF_RenderText_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
274
|
+
:TTF_RenderUTF8_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
275
|
+
:TTF_RenderUNICODE_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
276
|
+
:TTF_RenderGlyph_Solid => [:pointer, :ushort, Color.by_value],
|
277
|
+
:TTF_RenderGlyph32_Solid => [:pointer, :uint, Color.by_value],
|
278
|
+
:TTF_RenderText_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
279
|
+
:TTF_RenderUTF8_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
280
|
+
:TTF_RenderUNICODE_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
281
|
+
:TTF_RenderText_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
282
|
+
:TTF_RenderUTF8_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
283
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
284
|
+
:TTF_RenderGlyph_Shaded => [:pointer, :ushort, Color.by_value, Color.by_value],
|
285
|
+
:TTF_RenderGlyph32_Shaded => [:pointer, :uint, Color.by_value, Color.by_value],
|
286
|
+
:TTF_RenderText_Blended => [:pointer, :pointer, Color.by_value],
|
287
|
+
:TTF_RenderUTF8_Blended => [:pointer, :pointer, Color.by_value],
|
288
|
+
:TTF_RenderUNICODE_Blended => [:pointer, :pointer, Color.by_value],
|
289
|
+
:TTF_RenderText_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
290
|
+
:TTF_RenderUTF8_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
291
|
+
:TTF_RenderUNICODE_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
292
|
+
:TTF_RenderGlyph_Blended => [:pointer, :ushort, Color.by_value],
|
293
|
+
:TTF_RenderGlyph32_Blended => [:pointer, :uint, Color.by_value],
|
294
|
+
:TTF_RenderText_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
295
|
+
:TTF_RenderUTF8_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
296
|
+
:TTF_RenderUNICODE_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
|
297
|
+
:TTF_RenderText_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
298
|
+
:TTF_RenderUTF8_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
299
|
+
:TTF_RenderUNICODE_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
300
|
+
:TTF_RenderGlyph_LCD => [:pointer, :ushort, Color.by_value, Color.by_value],
|
301
|
+
:TTF_RenderGlyph32_LCD => [:pointer, :uint, Color.by_value, Color.by_value],
|
302
|
+
:TTF_CloseFont => [:pointer],
|
303
|
+
:TTF_Quit => [],
|
304
|
+
:TTF_WasInit => [],
|
305
|
+
:TTF_GetFontKerningSize => [:pointer, :int, :int],
|
306
|
+
:TTF_GetFontKerningSizeGlyphs => [:pointer, :ushort, :ushort],
|
307
|
+
:TTF_GetFontKerningSizeGlyphs32 => [:pointer, :uint, :uint],
|
308
|
+
:TTF_SetFontSDF => [:pointer, :int],
|
309
|
+
:TTF_GetFontSDF => [:pointer],
|
310
|
+
:TTF_SetDirection => [:int],
|
311
|
+
:TTF_SetScript => [:int],
|
312
|
+
:TTF_SetFontDirection => [:pointer, :int],
|
313
|
+
:TTF_SetFontScriptName => [:pointer, :pointer],
|
314
|
+
}
|
315
|
+
retvals = {
|
316
|
+
:TTF_Linked_Version => :pointer,
|
317
|
+
:TTF_GetFreeTypeVersion => :void,
|
318
|
+
:TTF_GetHarfBuzzVersion => :void,
|
319
|
+
:TTF_ByteSwappedUNICODE => :void,
|
320
|
+
:TTF_Init => :int,
|
321
|
+
:TTF_OpenFont => :pointer,
|
322
|
+
:TTF_OpenFontIndex => :pointer,
|
323
|
+
:TTF_OpenFontRW => :pointer,
|
324
|
+
:TTF_OpenFontIndexRW => :pointer,
|
325
|
+
:TTF_OpenFontDPI => :pointer,
|
326
|
+
:TTF_OpenFontIndexDPI => :pointer,
|
327
|
+
:TTF_OpenFontDPIRW => :pointer,
|
328
|
+
:TTF_OpenFontIndexDPIRW => :pointer,
|
329
|
+
:TTF_SetFontSize => :int,
|
330
|
+
:TTF_SetFontSizeDPI => :int,
|
331
|
+
:TTF_GetFontStyle => :int,
|
332
|
+
:TTF_SetFontStyle => :void,
|
333
|
+
:TTF_GetFontOutline => :int,
|
334
|
+
:TTF_SetFontOutline => :void,
|
335
|
+
:TTF_GetFontHinting => :int,
|
336
|
+
:TTF_SetFontHinting => :void,
|
337
|
+
:TTF_GetFontWrappedAlign => :int,
|
338
|
+
:TTF_SetFontWrappedAlign => :void,
|
339
|
+
:TTF_FontHeight => :int,
|
340
|
+
:TTF_FontAscent => :int,
|
341
|
+
:TTF_FontDescent => :int,
|
342
|
+
:TTF_FontLineSkip => :int,
|
343
|
+
:TTF_GetFontKerning => :int,
|
344
|
+
:TTF_SetFontKerning => :void,
|
345
|
+
:TTF_FontFaces => :long,
|
346
|
+
:TTF_FontFaceIsFixedWidth => :int,
|
347
|
+
:TTF_FontFaceFamilyName => :pointer,
|
348
|
+
:TTF_FontFaceStyleName => :pointer,
|
349
|
+
:TTF_GlyphIsProvided => :int,
|
350
|
+
:TTF_GlyphIsProvided32 => :int,
|
351
|
+
:TTF_GlyphMetrics => :int,
|
352
|
+
:TTF_GlyphMetrics32 => :int,
|
353
|
+
:TTF_SizeText => :int,
|
354
|
+
:TTF_SizeUTF8 => :int,
|
355
|
+
:TTF_SizeUNICODE => :int,
|
356
|
+
:TTF_MeasureText => :int,
|
357
|
+
:TTF_MeasureUTF8 => :int,
|
358
|
+
:TTF_MeasureUNICODE => :int,
|
359
|
+
:TTF_RenderText_Solid => :pointer,
|
360
|
+
:TTF_RenderUTF8_Solid => :pointer,
|
361
|
+
:TTF_RenderUNICODE_Solid => :pointer,
|
362
|
+
:TTF_RenderText_Solid_Wrapped => :pointer,
|
363
|
+
:TTF_RenderUTF8_Solid_Wrapped => :pointer,
|
364
|
+
:TTF_RenderUNICODE_Solid_Wrapped => :pointer,
|
365
|
+
:TTF_RenderGlyph_Solid => :pointer,
|
366
|
+
:TTF_RenderGlyph32_Solid => :pointer,
|
367
|
+
:TTF_RenderText_Shaded => :pointer,
|
368
|
+
:TTF_RenderUTF8_Shaded => :pointer,
|
369
|
+
:TTF_RenderUNICODE_Shaded => :pointer,
|
370
|
+
:TTF_RenderText_Shaded_Wrapped => :pointer,
|
371
|
+
:TTF_RenderUTF8_Shaded_Wrapped => :pointer,
|
372
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => :pointer,
|
373
|
+
:TTF_RenderGlyph_Shaded => :pointer,
|
374
|
+
:TTF_RenderGlyph32_Shaded => :pointer,
|
375
|
+
:TTF_RenderText_Blended => :pointer,
|
376
|
+
:TTF_RenderUTF8_Blended => :pointer,
|
377
|
+
:TTF_RenderUNICODE_Blended => :pointer,
|
378
|
+
:TTF_RenderText_Blended_Wrapped => :pointer,
|
379
|
+
:TTF_RenderUTF8_Blended_Wrapped => :pointer,
|
380
|
+
:TTF_RenderUNICODE_Blended_Wrapped => :pointer,
|
381
|
+
:TTF_RenderGlyph_Blended => :pointer,
|
382
|
+
:TTF_RenderGlyph32_Blended => :pointer,
|
383
|
+
:TTF_RenderText_LCD => :pointer,
|
384
|
+
:TTF_RenderUTF8_LCD => :pointer,
|
385
|
+
:TTF_RenderUNICODE_LCD => :pointer,
|
386
|
+
:TTF_RenderText_LCD_Wrapped => :pointer,
|
387
|
+
:TTF_RenderUTF8_LCD_Wrapped => :pointer,
|
388
|
+
:TTF_RenderUNICODE_LCD_Wrapped => :pointer,
|
389
|
+
:TTF_RenderGlyph_LCD => :pointer,
|
390
|
+
:TTF_RenderGlyph32_LCD => :pointer,
|
391
|
+
:TTF_CloseFont => :void,
|
392
|
+
:TTF_Quit => :void,
|
393
|
+
:TTF_WasInit => :int,
|
394
|
+
:TTF_GetFontKerningSize => :int,
|
395
|
+
:TTF_GetFontKerningSizeGlyphs => :int,
|
396
|
+
:TTF_GetFontKerningSizeGlyphs32 => :int,
|
397
|
+
:TTF_SetFontSDF => :int,
|
398
|
+
:TTF_GetFontSDF => :int,
|
399
|
+
:TTF_SetDirection => :int,
|
400
|
+
:TTF_SetScript => :int,
|
401
|
+
:TTF_SetFontDirection => :int,
|
402
|
+
:TTF_SetFontScriptName => :int,
|
403
|
+
}
|
404
|
+
symbols.each do |sym|
|
405
|
+
begin
|
406
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
407
|
+
rescue FFI::NotFoundError => error
|
408
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
end
|
414
|
+
|