2 ms·
There is a point. Subpixel positioning is important and it's hard to know how much memory will be taken up by the full set of characters. Because you can not kn
by microcolonel 10y ago
There is a point. Subpixel positioning is important and it's hard to know how much memory will be taken up by the full set of characters. Because you can not know the advances(and hence the exact positions) before you render the characters, you can not render them ahead of time without quantizing the position and storing multiple bitmaps.
This quickly becomes a non-optimization.
- Ono-Sendai 10y agoSure you could. Just resample the bitmap.
- p0nce 10y agoWhat I do is rounding the glyph position to 1/4 of pixels, in my tests it has not much visual impact. That still mean in the worst case the glyph cache could contains 16x the same glyph, and that's before hinting enters the equation.
- panic 10y agoYou can get good subpixel rendering from a single bitmap using a larger prefiltered glyph: https://github.com/nothings/stb/tree/master/tests/oversample https://github.com/nothings/stb/tree/master/tests/oversample