Open SnapperTT opened 5 years ago
Sorry I didn't think about this earlier, but this library compiles slightly differently for SDL and SDL_gpu. SDL uses a rect structure that stores integers, while SDL_gpu uses one that stores floats. SDL_FontCache uses a #define to make FC_Rect match the rect used by the appropriate rendering system. The solution here should depend on which system is being used so the floating point precision is preserved for SDL_gpu instead of always truncating to int.
This could be fixed by having:
#ifdef SDL_gpu (or other)
#define FC_COORD float
#else
#define FC_COORD int
#endif
And replacing all (int) casts with (FC_COORD) casts. Sound good for me to do this?
Yep, I'm good with that.
Updated. Also changed #include "SDL.h" to #include
Hey, no problem. I've got plenty to occupy me. :)
I'd prefer it as "SDL.h" because it should be checking project-defined search directories before checking standard install locations.
I've reverted the <> to "", and took a crack at #29 .
I've added a "fallback" member to FC_Font, added "void FC_AddFallback(base_font, fallback_font)" which adds the fallback font to the end of the fallback font linked list, and added the font switching to SDL_FontCache.c:1617.
The font switching does "work" - it does successfully load glyphs from other fonts, however the is-glyph-missing detection does not work, so its commented out, so that when a suitable fix is found it can be easily applied
Adds a number of int casts to take out gcc -wnarrowing spam