1/29/2024 0 Comments Enfold iconbox text looks cut offIf anyone is knowledgeable about text rendering and has ideas how to improve ours I'd be happy to hear about it. It's a nice bonus that it performs much much faster than Direct2D ever could, thanks to us assuming that each glyph fits into the terminal's raster grid, but clearly this isn't a perfect solution either. I'm not a text rendering expert and I've always considered our custom text renderer ("AtlasEngine") to be a "hack" which just works around our immediate performance problems we had. Given that Direct2D already handles this perfectly, it might be easier to port our text rendering improvements to Direct2D than it is to replicate Direct2Ds text renderer in Windows Terminal in full. The performance would end up being terrible. Joining overlapping glyphs and rasterizing them as one large glyph solves the problem.īut what is the heuristic here? If you simply join all overlapping glyphs you might get a perfect result, but now a screen full of slanted/italic text would all be rendered as one huge glyph with effectively no caching at all. It also doesn't work with ClearType which a lot of our users use (ClearType doesn't support alpha blending). What if the overlapping glyphs intentionally form a ligature? Overlapping them by simply alpha-blending them would mean that the anti-aliased border of the glyph ends up too opaque at the point of the overlap. It's easy to do this sloppy and hard to do correctly.Īfter all, you can't just draw each glyph on its own quad. This is how most text renderers including Direct2D do it. Then during rendering you have to render each glyph on its own rectangular polygon (quad). This will require the use of a bin packing algorithm to store glyph textures. Implementing a glyph atlas with arbitrarily sized glyphs correctly and properly is a lot more annoying. Implementing the heuristic for that is pretty simple after all. What I was planning to solve in the near term is joining ambiguous emojis with a trailing whitespace to make Windows Terminal behave like other terminals in that regard. Yeah I still do, but it's not trivial to decide on a proper heuristic here. I thought at one point that you had planned to allow characters to overflow their cell, which I assumed would largely solve this problem (at leat if we're also rendering the background in a separate pass - I'm not sure if that's true yet).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |