I have an SDF atlas (8bit grayscale) with all the Arial glyphs, which is about 16k^2 pixels. Rendering text works more or less fine, but such texture eats about 256MB of GPU memory. Graphics system is OpenGL.
Q: Are there any solutions as to not having to use such large texture while maintaining the ability to render any character from the Arial font?
I am using my own implementation of standalone SDF generator which actually first renders all the glyphs using WPF and then calculates the SDF using CUDA (naive implementation, per pixel brute-force, takes about 20 minutes to calculate, I do not have the skill to optimize it), but because of that WPF stuff, that approach is a no go for on-the-fly atlas generation for individual strings (speed, D3D9). Generating even a small SDF on the fly on the GPU would also not be stunningly fast and might introduce lags in rendering.
I just want to avoid using any libs like FreeType and at the same time do not want to end up implementing the whole TTF standard - after all it is just a hobby project, ít is not in my capacity.
I was thinking about something like keeping an MRU atlas and update it accordingly every time I render a string, but that would require a lot of housekeeping code - mapping from the main atlas, on-the-fly packing, tracking MRU glyphs coordinates in the atlas and last but not least might cause even bigger slowdowns when rendering larger or many strings with lots of different characters.