summaryrefslogtreecommitdiff
path: root/src/abi.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 12:53:22 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:22:02 -0300
commit45f705a5e590c3dfddc0a544e66beb9bf6205a4d (patch)
treec98d19a1b2dfc4808a46b41cf1b931703ff467b1 /src/abi.zig
parentf8d3a32f4f995eeb7e162b0702998b0565c11e4e (diff)
downloadsketchbook-45f705a5e590c3dfddc0a544e66beb9bf6205a4d.tar.gz
sketchbook-45f705a5e590c3dfddc0a544e66beb9bf6205a4d.zip
sketchbook: text rasterized at one scale and drawn at another (f.textScaled), steady under a moving camera
Diffstat (limited to 'src/abi.zig')
-rw-r--r--src/abi.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/abi.zig b/src/abi.zig
index 327110d..cf7b838 100644
--- a/src/abi.zig
+++ b/src/abi.zig
@@ -346,8 +346,11 @@ pub const Command = union(enum) {
/// The blend for the 2D commands after it (`rect`, `shape`, `image`;
/// `text` and `clear` ignore it). Each frame starts with `alpha`.
blend: BlendMode,
- /// One line from its top left corner; scale 1 is a 13 px font.
- text: struct { x: f32, y: f32, scale: f32, color: Color, bytes: []const u8, face: Face = .mono },
+ /// One line from its top left corner; scale 1 is a 13 px font. With
+ /// `raster` (not 0) it is laid out and rasterized at that scale and
+ /// drawn at `scale`: steady under a moving camera, where text shaped
+ /// anew at every size would shift letter against letter.
+ text: struct { x: f32, y: f32, scale: f32, color: Color, bytes: []const u8, face: Face = .mono, raster: f32 = 0 },
clip: ?Rect,
/// Logical canvas size; the host scales the window to fit.
canvas: struct { w: u32, h: u32 },