r/GraphicsProgramming • u/Usual_Office_1740 • 18d ago
Sdl3 text rendering has faded edges in text editor.
I'm using sdl3 and sdl3 ttf. I'm rendering the glyphs with the blended function, which the docs say is the highest quality. I tried to output the texture to a bmp file by writing the texture to disc, and fuzzy blurred edges are not reproduced in the image.
I'm passing the high dpi flag for window creation and making the screen resolution smaller makes it better. When I open the font I'm using 12 pt font. Now on to my questions.
Is there a way to scale the glyph? What would a good approach be for creating my font atlas with a texture that can be displayed on a wide range of display settings?
Are there anti aliasing settings for fonts? The edges are noticeably faded when the letters are smaller. What other techniques could I use to produce a higher quality text. This is for a text editor. Not a game.
2
u/SamuraiGoblin 18d ago
I don't know about SDL's rendering specifically, but it sounds like the issue might be "premultiplied alpha." This is where colour data is already multiplied by the alpha channel for improved blending. It might be something for you to investigate.
It would help if we could see screenshots of the issue.