I have worked on Ghostty’s font and glyph rendering so that mixed-color fonts, Nerd Font symbols, and emoji display correctly in terminal cells.
Ghostty now supports fonts with mixed color and non-color glyphs.
To detect mixed-color glyphs, I had to write my own font table parsers.
CoreText and FreeType both only have face-level colorization detection.
Ghostty now parses the Nerd font patcher to map the constraints into Zig, then applies them dynamically for your grid size.
The Nerd Font symbol work reduced Ghostty’s binary size by 20%.
I use another Python script with the ast package to parse the patcher; then eval some of the loops in order to extract our own data table; we do this once and commit the result into the source tree.
AI vibe coded most of that for us because its tedious as hell.
I said, “the first time I've seen any software do anything like this.”
Ghostty previously fell back to symbols from the patched JetBrainsMono font, which could look wrong for a user’s actual font grid; Now we adjust it dynamically for your real font.
Most importantly: you don't need to patch your fonts anymore.
I noted that our runtime constraints aren't completely identical to the Nerd font patcher but produce very good results; patched fonts may still produce slightly more consistent results.
The end result is that glyphs are properly aligned within the grid, especially across varying font faces and for unpatched fonts.
For us as maintainers, it also means that we can very easily update to new Nerd font versions to get you all the latest symbols in releases.
Emoji are now centered vertically and horizontally within grid cells.
Emoji were previously left-aligned within grid cells.
I noted that the pixels being wrong triggered some people.
Related: font rendering challenges, renderer performance optimization, terminal apis and capabilities