Repository navigation
Render bold and italic through customizable faces - #703
Merged
Merged
Conversation
dakra
force-pushed
the
feat/bold-italic-faces
branch
from
September 18, 2026 09:01
c882824 to
671d9eb
Compare
The face plist that the renderer and the comint filter put on terminal text carried a literal :weight bold and :slant italic, so Emacs's own `bold' and `italic' faces were never consulted. There was also nothing to customize in their place, because an anonymous plist cannot be face remapped. Anyone whose default face is light, and who therefore softens `bold' to keep the contrast bearable, got full-strength bold anyway. Emit :inherit ghostel-bold and :inherit ghostel-italic instead, two new faces inheriting `ansi-color-bold' and `ansi-color-italic' as the 16 color faces beside them inherit `ansi-color-*', and as term.el's `term-bold' and `term-italic' do. Customizing either those or `bold' and `italic' behind them reaches terminal output. :inherit comes first in the plist: Emacs merges it where it appears, so the foreground `ghostel-bold-color' sets still outranks the inherited face. Faint keeps blending the foreground toward the background rather than taking a face, matching Ghostty, and underline keeps its literal attributes because it carries style and color variants. Correct the README's claim that the color faces inherit `term-color-*'. Fixes #700.
dakra
force-pushed
the
feat/bold-italic-faces
branch
from
September 18, 2026 09:08
671d9eb to
d07e4bf
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The face plist that the renderer and the comint filter put on terminal text
carried a literal
:weight boldand:slant italic, so Emacs's ownboldand
italicfaces were never consulted. There was also nothing to customizein their place: an anonymous plist cannot be face remapped, and setting a
weight on
ghostel-defaultloses to the explicit attribute on the run.Anyone whose default face is light, and who therefore softens
boldto keepthe contrast bearable, got full-strength bold anyway.
Change
ghostel-boldandghostel-italicinheritansi-color-boldandansi-color-italic, the way the 16 color faces beside them inheritansi-color-*and the way term.el'sterm-boldandterm-italicdo. Theplist now carries
:inherit ghostel-bold,:inherit ghostel-italic, or bothas a list. Customizing either those faces or
boldanditalicbehind themreaches terminal output.
:inheritis emitted first because Emacs merges a plist's:inheritat theposition it appears and lets later keys overwrite it. That keeps the
foreground
ghostel-bold-colorsets outranking anything the face carries. Atest pins that order, since a reorder would break bold coloring silently.
Faint still blends the foreground toward the background, matching Ghostty
rather than eat's
:weight light. Underline, strike-through and overline keeptheir literal attributes, since underline carries style and color variants
that a single inherited face cannot express.
Also corrects the README, which claimed the color faces inherit
term-color-*when they inherit
ansi-color-*.Emacs 28.2
Emacs defines
ansi-color-boldwith a quoted inherit,:inherit 'bold, until29.1. Resolving that through
face-attributeyieldsunspecified, which lookslike a broken chain, but the merge path that actually renders text properties
treats the quoted value as a face list, ignores the
quotesymbol and appliesbold. Checked against the 28.2 face form: settingboldto normal, light orultra-bold each reaches the rendered weight, and so does setting
ansi-color-bolddirectly.Verification
Checked in a live graphical frame, on the font object actually chosen for the
glyphs rather than on the face plist:
boldset to normal weight, bold terminaltext moved from the bold font face to the regular one.
which is the before and after side by side.
Customizing the face updates already-rendered output on the next redisplay.
No redraw or cache clearing is needed.
make -j8 allpasses. One unrelated failure,ghostel-test-plain-link-detection-drains-in-chunks, reproduces onmainwith pristine code whenever the checkout path is long enough, so it is not
from this change. It asserts that the final scan tick's requested start equals
point-min, but that start is computed before the scan widens to the logicalline start, so whether it lands exactly on
point-mindepends on line length,and the test's lines embed the repository's absolute path.
Fixes #700.