The SDL3 TTF library has the TextEngine API to build a font atlas targeting the CPU or GPU (eg
https://wiki.libsdl.org/SDL3_ttf/TTF_CreateGPUTextEngine). Its slightly more cumbersome because you have to work with TTF_Text objects instead of char*s but it's quite doable.