raylibtech/rtools

[rGuiStyler] Issue with fonts loading

Closed this issue · 2 comments

i use rguistyler to create a style.h file..
I import it and call the GuiLoadStyleLightDefault() function
it works like i expect it until i change the font.
I get the follow error when i compile for windows.

tcc -o overlay.exe overlay.c C:\raylib\raylib\src\raylib.rc.data -std=c99 -Wall -lmsvcrt -lraylib -lopengl32 -lgdi32 -lwinmm -lkernel32 -lshell32 -luser32 -Wl,-subsystem=gui
Process started (PID=1700) >>>
In file included from overlay.c:19:
style.h:1688: error: '}' expected (got ",")
<<< Process finished (PID=1700). (Exit code 1)

//this is the code in style.h at these lines
// Font characters info data
1687: static const CharInfo fontChars[224] = {
1688: { 32, { 1, 1, 3, 10 }, 0, 0, 0, 0 },
1689: { 33, { 5, 1, 1, 10 }, 0, 0, 0, 0 },

when i cross compile for RPI i get endless warnings then errors

style.h:1911:23: note: (near initialization for 'fontChars[223].offsetX')
style.h:1911:26: warning: excess elements in scalar initializer
{ 255, { 41, 100, 5, 10 }, 0, 0, 0, 0 },
^~
style.h:1911:26: note: (near initialization for 'fontChars[223].offsetX')
style.h: In function 'GuiLoadStyleLightDefault':
style.h:1924:22: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
Image imFont = { imFontData, 128, 128, 1, 2 };
^~~~~~~~~~
style.h:1925:19: error: incompatible types when initializing type 'int' using type 'Texture2D' {aka 'struct Texture2D'}
Font font = { LoadTextureFromImage(imFont), 10, 224, 0 };
^~~~~~~~~~~~~~~~~~~~
style.h:1932:5: warning: implicit declaration of function 'GuiFont'; did you mean 'GuiLine'? [-Wimplicit-function-declaration]
GuiFont(font);
^~~~~~~
GuiLine
<<< Process finished (PID=9180). (Exit code 1)

If i dont select a font everything works fine.

Im using raygui v2.6
and lastest raylib from git.

@gezzuzz thanks for reporting! I'm publishing new rGuiStyler and rGuiLayout tools this weekend, to work with raygui 2.6.

@gezzuzz Just published rGuiStyler 3.1, it should work now.

Feel free to reopen if still failing.