Re:Aminal: Golang terminal emulator from scratch
by bpye on Wednesday November 28, 2018 @01:49AM
(#18549725)
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.
[ Parent
| on HN ]
Re:Aminal: Golang terminal emulator from scratch
by jchw on Wednesday November 28, 2018 @02:29AM
(#18549850)
You 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.
Re:Aminal: Golang terminal emulator from scratch
by bpye on Wednesday November 28, 2018 @11:29AM
(#18552840)
Ah 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?