Skip to content

Native-resolution surfaces and anti-aliased vector text - #6

Merged
Baker-Harrison merged 3 commits into
mainfrom
claude/project-thread-10f5vi-ui-native
Nov 1, 2026
Merged

Baker-Harrison merged 3 commits into
mainfrom
claude/project-thread-10f5vi-ui-native

Conversation

@Baker-Harrison

Copy link
Copy Markdown
Owner

Requested by Harrison · project thread

Step 1 of the approved quality-by-construction plan, stacked on #5.

What changes

  • Native resolution. The Cocoa window reads backingScaleFactor, sets the layer's contents scale and creates the Metal drawable (and the CPU framebuffer) in physical pixels. Win32 becomes DPI aware and creates its window at the system DPI scale. X11 honors ENGINE_UI_SCALE or GDK_SCALE. Window::size() now returns physical pixels and Window::scale_factor() reports the scale; run prints both.
  • Vector text. The 5x7 bitmap font is deleted. src/font.rs holds hand-written stroke outlines for letters, digits and punctuation, and Ui tessellates them into ribbons with a one-pixel analytic anti-aliasing fringe (per-vertex alpha), so text is crisp at any size and DPI. Ui::set_target tells the UI the real pixel size so the fringe stays one pixel wide.
  • Overlay primitive. Scene::overlay is now Vec<OverlayItem> (rect or alpha-blended triangle), drawn by the CPU, Vulkan and Metal paths. The dynamic vertex budget rose to 400k.

Verified on Linux

  • New tests: text is anti-aliased and coverage does not depend on resolution, every printed character has an outline. Workspace tests and the CPU/GPU parity test pass; Vulkan frames and the xvfb window path reviewed.
  • Metal, Cocoa scale handling and Win32 DPI are type-checked only; please look at text sharpness on the Mac.

Generated by Claude Code

Windows report physical pixels and a scale factor (Retina on Cocoa, system DPI on
Win32, ENGINE_UI_SCALE or GDK_SCALE on X11) and every renderer is created at
that size. The 5x7 bitmap font is replaced by an in-repo stroke outline font
tessellated into analytic anti-aliased triangles through a new overlay triangle
primitive, drawn by the CPU, Vulkan and Metal paths.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PtKQ2WViU4Go8As9to1xh
@Baker-Harrison Baker-Harrison self-assigned this Nov 1, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PtKQ2WViU4Go8As9to1xh
@Baker-Harrison
Baker-Harrison changed the base branch from claude/project-thread-10f5vi-game to main November 1, 2026 03:29
@Baker-Harrison
Baker-Harrison merged commit 03be8d2 into main Nov 1, 2026
6 checks passed
@Baker-Harrison
Baker-Harrison deleted the claude/project-thread-10f5vi-ui-native branch November 1, 2026 04:21
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.

2 participants