Render box characters ourselves (don't use font glyphs)
Several other terminal emulators (not all) render box characters themselves, rather than using font glyphs.
In a perfect world, all terminal fonts would have box characters glyphs, and we wouldn't have to do anything special at all.
That however is not the case. Many fonts lack these characters, causing foot to use glyphs from fallback fonts instead. Often, these don't match the primary font's dimensions exactly, which is a problem in this case since they need to be pixel perfect to look good.
Foot currently uses font glyphs. If we are to render the glyphs ourselves, the following things need to be considered:
- We should probably generate the glyphs on-demand
- We should probably cache the glyphs once generated
- Caching could be done in foot, but then all regular characters would go through two cache lookups: foot's box character cache, and fcft's glyph cache.
- Or, we could add an API to fcft to insert a glyph into its cache.
- There are a lot of glyphs to render...
If I may voice an opinion, please consider the attached screenshot.
Foot on the left, VTE-based xfce4-terminal on the right, both configured to use Hack font 15 pt under void linux sway.
The vertical gaps in foot are most likely not going to go away even if there is an adjustable line-height, since some anti-aliasing will render the vertical line end as a blurred end, whilst the harfbuzz magic will only treat the horizontal glyphs as continuation glyphs.
If I may voice an opinion
Of course you may :)
The title of this issue doesn't really reflect its status; I made up my mind some time ago that this is no longer a question of doing or not doing: we're doing it.
The antialiasing issue was brought up on IRC a while ago. I personally use bitmap fonts and hadn't noticed that one before.
Antialiasing and line hight issues aside, there is still the problem with fallback fonts; far too many fonts lack these glyphs (especially the new Unicode 13 sextant characters...), making rendering these glyphs unpredictable - some characters may be from the primary font, or fallback font A, while others are from fallback font B.
At this point, we just need to decide on how to glyph caching. After that, glyphs can be added iteratively.
Deleting a branch is permanent. It CANNOT be undone. Continue?