-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsdl2_ttf.nelua
117 lines (117 loc) · 11 KB
/
sdl2_ttf.nelua
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
##[[
cinclude '<SDL2/SDL_ttf.h>'
linklib 'SDL2_ttf'
]]
global function TTF_Linked_Version(): *SDL_version <cimport,nodecl> end
global function TTF_GetFreeTypeVersion(major: *cint, minor: *cint, patch: *cint): void <cimport,nodecl> end
global function TTF_GetHarfBuzzVersion(major: *cint, minor: *cint, patch: *cint): void <cimport,nodecl> end
global function TTF_ByteSwappedUNICODE(swapped: SDL_bool): void <cimport,nodecl> end
global TTF_Font: type <cimport,nodecl,forwarddecl> = @record{}
global function TTF_Init(): cint <cimport,nodecl> end
global function TTF_OpenFont(file: cstring, ptsize: cint): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontIndex(file: cstring, ptsize: cint, index: clong): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontRW(src: *SDL_RWops, freesrc: cint, ptsize: cint): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontIndexRW(src: *SDL_RWops, freesrc: cint, ptsize: cint, index: clong): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontDPI(file: cstring, ptsize: cint, hdpi: cuint, vdpi: cuint): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontIndexDPI(file: cstring, ptsize: cint, index: clong, hdpi: cuint, vdpi: cuint): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontDPIRW(src: *SDL_RWops, freesrc: cint, ptsize: cint, hdpi: cuint, vdpi: cuint): *TTF_Font <cimport,nodecl> end
global function TTF_OpenFontIndexDPIRW(src: *SDL_RWops, freesrc: cint, ptsize: cint, index: clong, hdpi: cuint, vdpi: cuint): *TTF_Font <cimport,nodecl> end
global function TTF_SetFontSize(font: *TTF_Font, ptsize: cint): cint <cimport,nodecl> end
global function TTF_SetFontSizeDPI(font: *TTF_Font, ptsize: cint, hdpi: cuint, vdpi: cuint): cint <cimport,nodecl> end
global function TTF_GetFontStyle(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_SetFontStyle(font: *TTF_Font, style: cint): void <cimport,nodecl> end
global function TTF_GetFontOutline(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_SetFontOutline(font: *TTF_Font, outline: cint): void <cimport,nodecl> end
global function TTF_GetFontHinting(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_SetFontHinting(font: *TTF_Font, hinting: cint): void <cimport,nodecl> end
global function TTF_GetFontWrappedAlign(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_SetFontWrappedAlign(font: *TTF_Font, align: cint): void <cimport,nodecl> end
global function TTF_FontHeight(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_FontAscent(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_FontDescent(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_FontLineSkip(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_GetFontKerning(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_SetFontKerning(font: *TTF_Font, allowed: cint): void <cimport,nodecl> end
global function TTF_FontFaces(font: *TTF_Font): clong <cimport,nodecl> end
global function TTF_FontFaceIsFixedWidth(font: *TTF_Font): cint <cimport,nodecl> end
global function TTF_FontFaceFamilyName(font: *TTF_Font): cstring <cimport,nodecl> end
global function TTF_FontFaceStyleName(font: *TTF_Font): cstring <cimport,nodecl> end
global function TTF_GlyphIsProvided(font: *TTF_Font, ch: uint16): cint <cimport,nodecl> end
global function TTF_GlyphIsProvided32(font: *TTF_Font, ch: uint32): cint <cimport,nodecl> end
global function TTF_GlyphMetrics(font: *TTF_Font, ch: uint16, minx: *cint, maxx: *cint, miny: *cint, maxy: *cint, advance: *cint): cint <cimport,nodecl> end
global function TTF_GlyphMetrics32(font: *TTF_Font, ch: uint32, minx: *cint, maxx: *cint, miny: *cint, maxy: *cint, advance: *cint): cint <cimport,nodecl> end
global function TTF_SizeText(font: *TTF_Font, text: cstring, w: *cint, h: *cint): cint <cimport,nodecl> end
global function TTF_SizeUTF8(font: *TTF_Font, text: cstring, w: *cint, h: *cint): cint <cimport,nodecl> end
global function TTF_SizeUNICODE(font: *TTF_Font, text: *uint16, w: *cint, h: *cint): cint <cimport,nodecl> end
global function TTF_MeasureText(font: *TTF_Font, text: cstring, measure_width: cint, extent: *cint, count: *cint): cint <cimport,nodecl> end
global function TTF_MeasureUTF8(font: *TTF_Font, text: cstring, measure_width: cint, extent: *cint, count: *cint): cint <cimport,nodecl> end
global function TTF_MeasureUNICODE(font: *TTF_Font, text: *uint16, measure_width: cint, extent: *cint, count: *cint): cint <cimport,nodecl> end
global function TTF_RenderText_Solid(font: *TTF_Font, text: cstring, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Solid(font: *TTF_Font, text: cstring, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Solid(font: *TTF_Font, text: *uint16, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_Solid_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Solid_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Solid_Wrapped(font: *TTF_Font, text: *uint16, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph_Solid(font: *TTF_Font, ch: uint16, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph32_Solid(font: *TTF_Font, ch: uint32, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_Shaded(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Shaded(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Shaded(font: *TTF_Font, text: *uint16, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_Shaded_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Shaded_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Shaded_Wrapped(font: *TTF_Font, text: *uint16, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph_Shaded(font: *TTF_Font, ch: uint16, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph32_Shaded(font: *TTF_Font, ch: uint32, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_Blended(font: *TTF_Font, text: cstring, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Blended(font: *TTF_Font, text: cstring, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Blended(font: *TTF_Font, text: *uint16, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_Blended_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_Blended_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_Blended_Wrapped(font: *TTF_Font, text: *uint16, fg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph_Blended(font: *TTF_Font, ch: uint16, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph32_Blended(font: *TTF_Font, ch: uint32, fg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_LCD(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_LCD(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_LCD(font: *TTF_Font, text: *uint16, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderText_LCD_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUTF8_LCD_Wrapped(font: *TTF_Font, text: cstring, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderUNICODE_LCD_Wrapped(font: *TTF_Font, text: *uint16, fg: SDL_Color, bg: SDL_Color, wrapLength: uint32): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph_LCD(font: *TTF_Font, ch: uint16, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_RenderGlyph32_LCD(font: *TTF_Font, ch: uint32, fg: SDL_Color, bg: SDL_Color): *SDL_Surface <cimport,nodecl> end
global function TTF_CloseFont(font: *TTF_Font): void <cimport,nodecl> end
global function TTF_Quit(): void <cimport,nodecl> end
global function TTF_WasInit(): cint <cimport,nodecl> end
global function TTF_GetFontKerningSize(font: *TTF_Font, prev_index: cint, index: cint): cint <cimport,nodecl> end
global function TTF_GetFontKerningSizeGlyphs(font: *TTF_Font, previous_ch: uint16, ch: uint16): cint <cimport,nodecl> end
global function TTF_GetFontKerningSizeGlyphs32(font: *TTF_Font, previous_ch: uint32, ch: uint32): cint <cimport,nodecl> end
global function TTF_SetFontSDF(font: *TTF_Font, on_off: SDL_bool): cint <cimport,nodecl> end
global function TTF_GetFontSDF(font: *TTF_Font): SDL_bool <cimport,nodecl> end
global TTF_Direction: type <cimport,nodecl,using> = @enum(cint){
TTF_DIRECTION_LTR = 0,
TTF_DIRECTION_RTL = 1,
TTF_DIRECTION_TTB = 2,
TTF_DIRECTION_BTT = 3
}
global function TTF_SetDirection(direction: cint): cint <cimport,nodecl> end
global function TTF_SetScript(script: cint): cint <cimport,nodecl> end
global function TTF_SetFontDirection(font: *TTF_Font, direction: TTF_Direction): cint <cimport,nodecl> end
global function TTF_SetFontScriptName(font: *TTF_Font, script: cstring): cint <cimport,nodecl> end
global SDL_TTF_MAJOR_VERSION: cint <cimport,nodecl,const>
global SDL_TTF_MINOR_VERSION: cint <cimport,nodecl,const>
global SDL_TTF_PATCHLEVEL: cint <cimport,nodecl,const>
global SDL_TTF_COMPILEDVERSION: cint <cimport,nodecl,const>
global UNICODE_BOM_NATIVE: cint <comptime> = 0xfeff
global UNICODE_BOM_SWAPPED: cint <comptime> = 0xfffe
global TTF_STYLE_NORMAL: cint <comptime> = 0x00
global TTF_STYLE_BOLD: cint <comptime> = 0x01
global TTF_STYLE_ITALIC: cint <comptime> = 0x02
global TTF_STYLE_UNDERLINE: cint <comptime> = 0x04
global TTF_STYLE_STRIKETHROUGH: cint <comptime> = 0x08
global TTF_HINTING_NORMAL: cint <comptime> = 0
global TTF_HINTING_LIGHT: cint <comptime> = 1
global TTF_HINTING_MONO: cint <comptime> = 2
global TTF_HINTING_NONE: cint <comptime> = 3
global function SDL_TTF_VERSION_ATLEAST(x: cint, y: cint, z: cint): SDL_bool <cimport, nodecl> end
global function SDL_TTF_VERSION(x: *SDL_version) <cimport, nodecl> end
global function TTF_SetError(fmt: cstring, ...: cvarargs): cint <cimport, nodecl> end
global function TTF_GetError(): cstring <cimport, nodecl> end