3 ms·
With a fixed width font in a single size surely caching glyphs goes a long way? Most of the characters probably come from a small set of characters, and obvious
by bpye 8y ago
With a fixed width font in a single size surely caching glyphs goes a long way? Most of the characters probably come from a small set of characters, and obviously a cache can support full unicode. I guess you couldn't do subpixel hinting but an alpha blended character can be tinted any colour for FG/BG.
- jchw 8y agoYou can do caching with any renderer, GPU or not. Almost any text renderer caches glyphs to some degree. Of course, even fixed width fonts can have things like ligatures and composite characters which complicate matters. Rather than caching individual code points, you'd really need to cache something more like individual grapheme clusters. Subpixel rendering is tricky, but should be possible to do with shaders. You could just render to a normal single channel texture at 3x the horizontal spatial resolution (basically, stretched 3x horizontally) then when rendering move 1 pixel across the glyph rendering for each subpixel, alpha blending individually.
- bpye 8y agoAh true. I guess I personally do not use a font with ligatures so it didn't really come to mind. Subpixel renderering with shaders is a neat idea, is it something that has been done before?
- jchw 8y agoI don't know; I assume yes because it seems possible and I doubt I'm the very first person to think about it.
- bitwize 8y agoDon't forget, some fonts (particularly emoji) have multicolor glyphs!