Replace the M2 stub rasterizer with a real font rasterizer:
- build.zig.zon: add TrueType as a lazy path dependency
- build.zig: swap stub_rasterizer_mod for truetype_rasterizer_mod; link
fontconfig + libc on Linux; TrueType dep is lazy (falls back gracefully)
- src/gui/rasterizer/truetype.zig: andrewrk/TrueType rasterizer; loadFont
uses fontconfig to locate the font file, derives cell dimensions from
vertical metrics (ascent−descent) and 'M' advance width; render blits the
A8 glyph bitmap into the caller-provided staging buffer with correct
baseline placement (ascent_px + off_y) and double-wide support (+cell_w
x-offset for kind=.right); arena allocator per render call
- src/gui/rasterizer/font_finder.zig: OS dispatcher (Linux only for now)
- src/gui/rasterizer/font_finder/linux.zig: fontconfig C API - FcFontMatch
resolves a font name pattern to an absolute file path
Requires: libfontconfig-dev (already present alongside libgl-dev etc.)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move shared types out of src/win32/ into a new src/gui/ package:
- xy.zig: generic XY(T) coordinate type
- xterm.zig: 256-color palette table (used by all GPU renderers)
- GlyphIndexCache.zig: glyph→atlas-slot mapping
- Cell.zig: Rgba8 and Cell extracted from d3d11.zig
- GlyphRasterizer.zig: comptime interface spec/checker
Update src/win32/ imports to point to ../gui/ and delete the
moved originals.
Replace the -Dgui bool option with -Drenderer enum { terminal, gui,
d3d11 }, wiring .d3d11 to the existing win32 DirectWrite path and
keeping build_options.gui = (renderer != .terminal) for tui.zig.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Now that Widget addresses do not have to be stable we can greatly simplfy
and in the process eliminate the potential for update looping.
The closes#520
Widget is a handle type. Sort of a smart pointer. Comparing their addresses
is brittle because it requires keeping Widget pointers stable. This is
nonsense because Widget identity is actually determined by the actual
widget object it points to.
This big refactor elimits the requirement that Widget addresses remain
stable to work properly with Widget.walk and Widget.get.
Testing for precise rows leads to a "dead" area if cursor row is in topmost
half-screen of a file. Less strict comparison makes the command useful in
that area as well.