From 97abf3c37055144aa96218896bea21154d3645ec Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 10 Oct 2024 17:20:03 -0700 Subject: [PATCH] font/noop: conform to new run struct type --- src/font/shaper/noop.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/font/shaper/noop.zig b/src/font/shaper/noop.zig index 25b9a055f..f8988f4ee 100644 --- a/src/font/shaper/noop.zig +++ b/src/font/shaper/noop.zig @@ -111,7 +111,13 @@ pub const Shaper = struct { // expose a public API for this. const face = try run.grid.resolver.collection.getFace(run.font_index); for (state.codepoints.items) |entry| { - const glyph_index = face.glyphIndex(entry.codepoint); + const glyph_index = face.glyphIndex(entry.codepoint) orelse { + // The run iterator shared logic should guarantee that + // there is a glyph index for all codepoints in the run. + // This is not well tested because we don't use the noop + // shaper in any release builds. + unreachable; + }; try self.cell_buf.append(self.alloc, .{ .x = @intCast(entry.cluster), .glyph_index = glyph_index,