Skip to content

win32/host: add configurable glyph fonts - #13

Merged
coneilen merged 1 commit into
graphcode-hostfrom
coneilen-terminal-provider-parity
Oct 24, 2026
Merged

coneilen merged 1 commit into
graphcode-hostfrom
coneilen-terminal-provider-parity

Conversation

@coneilen

Copy link
Copy Markdown
Owner

Summary

  • add a separate versioned winghostty_font_config ABI and surface setter without changing the pinned v1/v2 surface option layouts
  • render caller-selected point sizes, width ratios, weights, and grayscale/natural hinting with provider-owned monitor DPI conversion
  • select ordered fallback families only after verifying the installed GDI face and grapheme glyph coverage, preserving the legacy Consolas path when no config is supplied

Validation

  • .\scripts\dev-windows.cmd zig build test -Dtest-filter=win32
  • .\scripts\dev-windows.cmd zig build test -Dtest-filter=scroll
  • .\scripts\dev-windows.cmd zig build test -Dtest-filter=keybind
  • .\scripts\dev-windows.cmd zig build -Demit-exe=true

Additional provider-specific validation on the final graphcode-host base:

  • passed .\scripts\dev-windows.cmd powershell -NoProfile -ExecutionPolicy Bypass -File .\test\windows\compile-win32-host-api.ps1 (C/C++, including -fshort-enums)
  • passed .\scripts\dev-windows.cmd powershell -NoProfile -ExecutionPolicy Bypass -File .\test\windows\run-win32-host-api-smoke.ps1
  • passed .\scripts\dev-windows.cmd powershell -NoProfile -ExecutionPolicy Bypass -File .\test\windows\run-win32-host-renderer.ps1 (3/3 fresh processes; 100 teardown cycles per process)
  • passed .\scripts\dev-windows.cmd zig test src\renderer\win32_glyph.zig -lc -lgdi32 -lkernel32 -luser32 (28/28)
  • passed .\scripts\dev-windows.cmd zig test src\win32_host.zig -lc -luser32 -lkernel32 -lgdi32 -lopengl32 -lole32 -loleaut32 (96/96)
  • passed .\scripts\dev-windows.cmd zig build -Demit-win32-host=true

The scroll and keybind filters were not run because this change is isolated to the embeddable host ABI and glyph renderer.

Risks / Follow-ups

  • automated tests prove ABI, validation, DPI math, fallback selection, cache separation, and WGL delivery; they do not prove live glyph raster or antialiasing appearance
  • GraphCode must bundle/register its selected JetBrains Mono and Nerd/Powerline fallback families, pass the final 11.7 pt value and width ratio, and provide logical 96-DPI cell metrics for matching grid/hit testing
  • the native GDI path still intentionally excludes complex shaping and color emoji

scgopi/GraphCode#775

Add a versioned font configuration API without changing the pinned
surface option layouts. The embeddable renderer now accepts a copied
primary family, ordered fallbacks, final point size, width ratio,
weight, and raster mode while preserving the legacy Consolas path.

Resolve configured faces explicitly, account for monitor DPI once,
and include the complete font configuration in glyph cache identity.
Cover the ABI, validation, fallback selection, and renderer path in the
native Windows contracts.

Co-authored-by: Copilot App <[email protected]>
@coneilen
coneilen force-pushed the coneilen-terminal-provider-parity branch from 8f400f7 to f83a3ef Compare October 24, 2026 17:36
@coneilen
coneilen merged commit e0a5579 into graphcode-host Oct 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant