You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today adjustGlyphs in src/Renderer.zig scales any glyph whose font metrics don't match default_font_info so it fits exactly inside its cell. For CJK characters on macOS this consistently shrinks them to ~84% of ASCII height, which looks visually unbalanced in Chinese / Japanese / Korean text.
face-font-rescale-alist cannot work around this, because Ghostel reads the rescaled glyph height and produces a reciprocal display height that cancels the rescale out.
Why a knob is preferable to a behavior change
I understand the current behavior is the right default — it guarantees strict grid alignment, which is one of the main reasons to use Ghostel over Vterm. The maintainer's rationale in #281 makes the design intent very clear, and I'm not asking to change it.
But for buffers that aren't running a TUI app (a plain shell, or a session that's mostly CJK prose / output), users may want their CJK to render at the font's natural size — at the cost of CJK rows being slightly taller than pure-ASCII rows. That tradeoff is worth exposing as a config.
Proposed configuration
Either of these would work; option 1 is more flexible.
ghostel-cjk-scale-floor (defcustom, float, default 0.0)
Clamp the computed scale: scale = max(scale_floor, computed_scale). A value of 1.0 disables shrinking entirely; 0.0 keeps current behavior. One @max after the existing @min in adjustGlyphs.
ghostel-disable-glyph-adjust (defcustom, bool, default nil)
Skip adjustGlyphs entirely when non-nil. Simpler but coarser — also disables the desirable behavior for too-large fallback Nerd-Font glyphs that Nerd Font glyphs render too small #281 fixed.
I'd vote for option 1: it preserves the alignment-correction story for fallback glyphs that are way too big, while still letting CJK render at natural size when the user opts in.
Reproduction
Doom Emacs on macOS, ghostel module pulled with ghostel-module-auto-install 'download
doom-font = CaskaydiaCove Nerd Font Mono 14pt
Global CJK fontset = Sarasa Mono SC (set-fontset-font t 'han ...)
Open ghostel, type any CJK character, M-x describe-char
Setting (setq face-font-rescale-alist '(("Sarasa Mono SC" . 1.3))) has no visible effect — Ghostel reads the rescaled height and emits a reciprocal scale.
Workaround
The only workaround today is to fork and patch src/Renderer.zig (clamp scale to 1.0, or drop the height half of the display spec) and rebuild ghostel-module.dylib. Not great for staying current with upstream.
Summary
Today
adjustGlyphsinsrc/Renderer.zigscales any glyph whose font metrics don't matchdefault_font_infoso it fits exactly inside its cell. For CJK characters on macOS this consistently shrinks them to ~84% of ASCII height, which looks visually unbalanced in Chinese / Japanese / Korean text.face-font-rescale-alistcannot work around this, because Ghostel reads the rescaled glyph height and produces a reciprocaldisplay heightthat cancels the rescale out.Why a knob is preferable to a behavior change
I understand the current behavior is the right default — it guarantees strict grid alignment, which is one of the main reasons to use Ghostel over Vterm. The maintainer's rationale in #281 makes the design intent very clear, and I'm not asking to change it.
But for buffers that aren't running a TUI app (a plain shell, or a session that's mostly CJK prose / output), users may want their CJK to render at the font's natural size — at the cost of CJK rows being slightly taller than pure-ASCII rows. That tradeoff is worth exposing as a config.
Proposed configuration
Either of these would work; option 1 is more flexible.
ghostel-cjk-scale-floor(defcustom, float, default0.0)Clamp the computed scale:
scale = max(scale_floor, computed_scale). A value of1.0disables shrinking entirely;0.0keeps current behavior. One@maxafter the existing@mininadjustGlyphs.ghostel-disable-glyph-adjust(defcustom, bool, defaultnil)Skip
adjustGlyphsentirely when non-nil. Simpler but coarser — also disables the desirable behavior for too-large fallback Nerd-Font glyphs that Nerd Font glyphs render too small #281 fixed.I'd vote for option 1: it preserves the alignment-correction story for fallback glyphs that are way too big, while still letting CJK render at natural size when the user opts in.
Reproduction
ghostel-module-auto-install 'downloaddoom-font=CaskaydiaCove Nerd Font Mono14ptSarasa Mono SC(set-fontset-font t 'han ...)M-x describe-chardisplay ((min-width (2)) (height 0.8421052631578947))(setq face-font-rescale-alist '(("Sarasa Mono SC" . 1.3)))has no visible effect — Ghostel reads the rescaled height and emits a reciprocal scale.Workaround
The only workaround today is to fork and patch
src/Renderer.zig(clampscaleto1.0, or drop the height half of the display spec) and rebuildghostel-module.dylib. Not great for staying current with upstream.