Subpixel rendering and very small font sizes #69
Replies: 2 comments 7 replies
-
I've done it before it's possible to do with OpenGL look into "Dual Source Blending" and OpenGL blending functions in general and how subpixel AA works. It's gonna work differently based on the display's subpixel geometry. |
Beta Was this translation helpful? Give feedback.
-
Before you start implementing some complicated solution, make sure that your SDF's pixel range is high enough. The default value is only sufficient for rendering at the same size as the SDF or larger. But again, subpixel rendering has nothing to do with MSDF. You can subpixel-render anything and the way you do it doesn't change. You could make a whole game engine that renders everyhing with subpixel anti-aliasing. However, you need to know the layout of the pixels of the user's monitor and that it is running in its native resolution. This is why subpixel text rendering is usually handled by the OS, which has this information. But if you do know the monitor's pixel layout, you just draw each color channel with a slightly offset position based on the layout and that's all there is to it. As for the other techniques, you might want to try supersampling if the SDF is being significantly downscaled, but the primary solution for this problem in text rendering is hinting, which is not really a good fit for SDF-based rendering. |
Beta Was this translation helpful? Give feedback.
-
Hi again! The MSDF atlas generation you've created is absolutely gorgeous, and is offering very good rendering capabilities for both small and larger font sizes. However, I have noticed that for very small font sizes (12pt and below) that the antialiasing, while very good, is not always as clear as text rendered with the subpixel rendering technique. The main difference is that the antialiasing at very small font sizes acts more like a blur. I am aware that Freetype has subpixel rendering as an option, but I am wondering if msdf-atlas-gen can be used to construct subpixel rendered text?
Might it be possible to take an MSDF rendered font atlas and translate it into its subpixel rendered equivalent? If not, does msdf-atlas-gen offer texture atlases generated with subpixel rendering, and might there be other techniques to increase readability of small text? I would really appreciate your input on the matter.
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions