You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Small font not working in "player" executableΒ #909
So i don't know exactly how is called, but the "player" executable (the one without the studio, that only plays a cart, like sdl-renderer), doesn't seem to print any small font text. Not sure why, since the functionality should be generic inside the engine.
To reproduce just make a cart with
cls(0)
print("ciao", 10, 10, 15, true, 1, true)
The issue affects libretro-core too (that's how i noticed) since it's based on the same "skeleton". For real life example, my game Doors of Doom doesn't show the info box on the right corner, that is printed in small fonts.
I did some more research on this bug, looks like small fonts are loaded from config.tic "system cartridge" when using the full Studio. They are loaded from the foreground spritesheet in studio.c at updateSystemFont(), which is called via config.c at every startup.
In the "player" version, they're only defined in tic80.c Font array, where evidently only the regular font is specified (i think, not sure what format the array is. But it's 1024 elements, so probably 128 char at 8 byte per char).
If i find the time, i'll try to dump the font after it's been loaded by studio and use that to replace the hardcoded one on tic80.c
Thanks! I made it to learn TIC-80. It was also my first Lua project. Code is a little messy, but does what I need.
Didn't have much time to investigate further, but some normal text is missing too. Only thing at the moment that came to my mind is, I use the values returned by print function to position some text in the project and maybe after update something changed or created another bug
There is also a chance that it previously worked by pure luck and I'm just dumb π
The main problem I see you're using print("test",x,y,-1) with -1 for the color variable.
Please, use 0-15 for color index instead -1. https://github.com/nesbox/TIC-80/wiki/print
Thank you.
Activity
RobLoach commentedon Aug 20, 2019
Confirmed. Here's the test....
font_small.tic.zip
And here's a screenshot in tic80_libretro. Same happens in
sdl-renderer.It's missing the small text.
nesbox commentedon Aug 20, 2019
Most likely the problem is here
TIC-80/src/tic80.c
Line 79 in 5f498e1
also, we have to add functionality to load a config cart in these "players"
The-Beesh-Spweesh commentedon Aug 20, 2019
How do you export a standalone binary without the editors?
msx80 commentedon Aug 20, 2019
I traced up to there too, but it's the only place where fonts are defined and it looks like it should work for both setups. Strange :)
i think it should look up in some default user/system folder but not write his own
msx80 commentedon Sep 3, 2019
I did some more research on this bug, looks like small fonts are loaded from config.tic "system cartridge" when using the full Studio. They are loaded from the foreground spritesheet in studio.c at updateSystemFont(), which is called via config.c at every startup.
In the "player" version, they're only defined in tic80.c Font array, where evidently only the regular font is specified (i think, not sure what format the array is. But it's 1024 elements, so probably 128 char at 8 byte per char).
If i find the time, i'll try to dump the font after it's been loaded by studio and use that to replace the hardcoded one on tic80.c
#909: hardcoded font fix
nesbox commentedon Sep 3, 2019
@msx80 thanks for the investigation, just pushed a fix b3e158c
RobLoach commentedon Sep 6, 2019
Confirmed the small font of "GUN" is being rendered in libretro. Nicely done!
nesbox commentedon Sep 6, 2019
@RobLoach thanks, so, we can close the issue...
Rottenland commentedon Nov 13, 2020
In my example after 0.80 release small font stopped working at all within my game
rotton_v0.48.tic.zip
RobLoach commentedon Nov 14, 2020
That's a great game! Curious why the small font won't work. Small font looks to be working in the cart posted over at #909 (comment)
Rottenland commentedon Nov 15, 2020
Thanks! I made it to learn TIC-80. It was also my first Lua project. Code is a little messy, but does what I need.
Didn't have much time to investigate further, but some normal text is missing too. Only thing at the moment that came to my mind is, I use the values returned by print function to position some text in the project and maybe after update something changed or created another bug
There is also a chance that it previously worked by pure luck and I'm just dumb π
nesbox commentedon Nov 15, 2020
The main problem I see you're using
print("test",x,y,-1)with-1for thecolorvariable.Please, use
0-15for color index instead-1.https://github.com/nesbox/TIC-80/wiki/print
Thank you.