╭ changed ──────────╮ │src/ui/SubTitle.zig│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │18 }; │ │19 } │ │20 │ │21 +pub fn width(self: Self) !usize { │ │22 + const line_end = std.mem.indexOfScalar(u8, self.content, '\n') orelse self.content.len;│ │23 + return xitui.width.displayWidth(self.content[0..line_end]); │ │24 +} │ │25 + │ │26 pub const View = struct { │ │27 text_box: wgt.TextBox, │ │28 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │391 }; │ │392 } │ │393 │ │394 +// whether every char of `text` has a glyph │ │395 +pub fn covers(text: []const u8) bool { │ │396 + for (text) |c| { │ │397 + if (glyphFor(c) == null) return false; │ │398 + } │ │399 + return true; │ │400 +} │ │401 + │ │402 // map a 2x3 sub-pixel pattern to its corresponding sextant codepoint│ │403 fn sextantCodepoint(pattern: u6) u21 { │ │404 return switch (pattern) { │ ╰──────────────────────────────────────────────────────────────────────────╯