Skip to content

macOS: dark text on a light background draws thinner than light on dark, with no setting like Ghostty's font-thicken #414

Open

Description

@abhijit-s

What did you try to build?

TL;DR: GPUI picks how much CoreGraphics thickens glyphs from the text colour, so dark text on light backgrounds draws noticeably thinner. I'd like a font_thicken setting that rasterises terminal glyphs as Ghostty's font-thicken does.

In a light theme, terminal text looks thinner than the same font and weight in a dark theme, and than in Ghostty. It shows most at light weights (font_weight, #332 and #333).

The cause is glyph_dilation_for_color in vendor/gpui-pre-macos/src/text_system.rs: with font smoothing on, it picks one of five dilation levels from the foreground colour's luminance, as CoreGraphics does. Dark text gets the lightest level and light text the heaviest. Measured with JetBrains Mono at 12px and 1x, weight 250: light on dark inks 0.134 of the cell, dark on light 0.107, about 20% less.

Ghostty's font-thicken and font-thicken-strength rasterise with smoothing on and a fixed gray fill, whatever the text colour, then tint. Both polarities then come out the same: at weight 400 and strength 30, both ink 0.126.

What is missing?

A setting. A mod can't change how glyphs are rasterised, and nothing in the layout look or settings.json reaches the text system.

Proposal: font_thicken (default off) and font_thicken_strength (0 to 255, default 255, as Ghostty), person settings for terminal text. Panels keep GPUI's behaviour.

What I built in my fork:

  • HERDR:-marked changes to vendored GPUI: RenderGlyphParams::thicken, part of the glyph atlas key, and Window::with_glyph_thicken, which the terminal paints its grid inside. The macOS rasteriser draws with smoothing on and a gray fill of strength / 255 in linear gray, and gives thickened glyphs 1px more raster room, as Ghostty pads them. Only the macOS rasteriser reads the field; on Linux and Windows the setting does nothing.
  • The row cache's key carries the strength, so changing it redraws every row.
  • Settings window: a "Thicken" toggle under the terminal font weight, and a "Thicken strength" stepper while it's on.
  • tests/thicken_ink.rs measures ink per polarity. Smoothing steps at strengths of about 112, 192, 224 and 255, so Ghostty's 30 lands on the lightest level.

About 260 lines. The settings row sits under #332's font weight row.

Would you accept a PR for this? It touches vendored GPUI, so I'd also like to know whether a HERDR:-marked patch there is fine.

Activity

  1. tanchihpin0517 commented on Nov 4, 2026

    @tanchihpin0517

    +1 from the dark-theme side, where the problem is the reverse. With TokyoNight Storm (fg #c0caf5) and Menlo 13, glyph_dilation_for_color picks level 3, so text looks clearly heavier than in Ghostty, whose default font-thicken = false turns smoothing off. Dimming the theme doesn't help: level 0 would need text darker than the background.

    Could the setting also allow no thickening? For example, font_thicken: "auto" (current behavior, the default), true (fixed strength) or false (smoothing off, like Ghostty's default).

  2. abhijit-s commented on Nov 4, 2026

    @abhijit-s
    ContributorAuthor

    TL;DR: #547 adds font_thicken and font_thicken_strength for terminal text, so both polarities ink alike, as Ghostty's font-thicken does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions