From d395739c8051e28726a4111eec1111a9c70567ec Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 24 Sep 2026 13:01:25 -0300 Subject: Turn ligatures off with a Ligatures setting, in the shell that shapes text The SDL shell shapes words with HarfBuzz, so a font's `->` and `!=` draw as ligatures, and there was no way to have the plain glyphs back short of changing font. `Ligatures` is a toggle, on by default; off, no cell goes to the shaper and every cell draws its own glyph, exactly as a font without ligatures does. It exists only where it means something. A new `ligatures` capability, true for the gui shell alone, gates it like Font and WindowOpacity are gated: it is not a builtin elsewhere, has no leader path, and Config does not list it, rather than print a row the TTY could never change. macOS draws CoreText ligatures of its own, but nothing there reads the setting, so it stays off there. The table check that kept every toggle unconditional now lets the ligatures toggle, and only it, carry a capability, and requires that it carry `ligatures`; every other setting's rule is as it was. The gui keeps the setting beside its text caches, which were resolved under it: when the core's value changes, the per-codepoint cells (which record whether a cell is shaped) and the shaped words are dropped, and the frame the toggle asked for draws every cell again. The atlas keeps its glyphs: plain ones draw either way, and a ligature's strip is reused when it comes back. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/config.md | 17 +++++++++++++---- docs/design.typ | 3 ++- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/config.md b/docs/config.md index d1cc2e6e..9c51f329 100644 --- a/docs/config.md +++ b/docs/config.md @@ -25,16 +25,19 @@ which `Config` reports as `no per-user config path`. `+Config` pane. It reports the startup path and every live config-like value: theme, colors, focus tint, syntax weight, wrapping, tag position, debug mode, the requested shell and the executable actually resolved at the last spawn, requested/effective GUI font -and size, tagline scale, window opacity, panel transition, +and size, tagline scale, window opacity, ligatures (SDL GUI only), panel transition, scene effects, hover delay, platform, native-image support, and (on SDL) whether the executable uses live-built shaders or the paired prebuilt shader snapshot. Platform-dependent rows say `unsupported` instead of looking like an off or -empty supported setting. The five fields of `config.Runtime.Capabilities` gate +empty supported setting. The fields of `config.Runtime.Capabilities` gate them and are stated once as plain data in `builtins.capabilities`: `font_picker` is the SDL GUI and native macOS only, `scene_shaders` the same two, `panel_transitions` every -hosted shell, `window_opacity` the SDL GUI only, and `tagline_font_size` -everything but the TTY and the board. So +hosted shell, `window_opacity` the SDL GUI and macOS, `window_blur` macOS +only, `ligatures` the SDL GUI only, and `tagline_font_size` +everything but the TTY and the board. `ligatures` is the exception to +`unsupported`: where it is off, `Ligatures` is not a builtin at all and +`Config` has no row for it. So the TTY reports Font, TaglineSize and the scene shaders as unsupported; the browser reports Font, panel transitions and the scene shaders as unsupported, and its TaglineSize row reads `82 (build-time only)` — tagline font size is @@ -133,6 +136,12 @@ the current value. A `FocusTint` line in a fresh startup configuration disables the tint; a `SyntaxBold` line enables the stronger keyword weight. Those two appearance controls leave focus, selections and editing behavior unchanged. +`Ligatures` (SDL GUI only) toggles a font's programming ligatures, such as +Maple Mono's `->` and `!=` drawn across their cells; it is on by default. +Off, every cell draws its own glyph, exactly as a font without ligatures does. +`Ligatures on` and `Ligatures off` set it explicitly. The native macOS shell +draws CoreText ligatures of its own, which this setting does not reach. + `TreeContext` toggles sticky declaration headers for the current source pane. It is off by default and appears in the default pane tag when a tree-sitter grammar supports that file. `TreeContext on` and `TreeContext off` set it diff --git a/docs/design.typ b/docs/design.typ index 8ec025f1..01b850b9 100644 --- a/docs/design.typ +++ b/docs/design.typ @@ -2043,7 +2043,8 @@ a tagline or a one-cell-tolerant pane separator latches to a left-mouse gesture for its lifetime, keeping layout drags out of the scroll heuristic. Touch input translation and scroll/tap state live entirely in the JavaScript shell. The native SDL shell uses a FreeType light-hinted grayscale atlas over the SDL GPU API (SPIR-V), -with words shaped by HarfBuzz so a font's ligatures span their cells. +with words shaped by HarfBuzz so a font's ligatures span their cells +(`Ligatures off` draws every cell as its own glyph). The browser exposes each cell as selectable, inspectable text and applies the surface styles with CSS. The browser `.snap` harness drives real Chromium touch input and reads both text and per-cell styles from the DOM renderer's packed -- cgit v1.3