╭ changed ─────────────╮ │src/ui/Fork/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │30 return .{ │ │31 .name = name, │ │32 .owner_name = owner_name, │ │33 - .title = try ui.Title.init(arena, name), │ │33 + .title = try ui.Title.init(arena, name, .scanlines),│ │34 .id = try arena.allocator().dupe(u8, id), │ │35 .oid = try arena.allocator().dupe(u8, oid), │ │36 }; │ ╰────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Home/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────╮ │21 │ │22 pub fn init(arena: *std.heap.ArenaAllocator) !Self { │ │23 return .{ │ │24 - .title = try ui.Title.init(arena, "haxy"), │ │24 + .title = try ui.Title.init(arena, "haxy", .scanlines),│ │25 }; │ │26 } │ │27 │ ╰──────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │43 return .{ │ │44 .name = name, │ │45 .owner_name = owner_name, │ │46 - .title = try ui.Title.init(arena, name), │ │46 + .title = try ui.Title.init(arena, name, .scanlines),│ │47 .ref_or_oid = ref_or_oid, │ │48 .ref_or_oid_value = ref_or_oid_value, │ │49 .issues_label = issues_label, │ ╰────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/ui/SubTitle.zig│ ╰───────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │62 // the two share a look. (the glyphs are 4 sub-pixels wide rather than 6, which │ │63 // is one sextant cell narrower per character.) the four 2x3 patterns that │ │64 // aren't sextants (empty, left column, right column, full) fall back to │ │65 -// U+0020, U+258C, U+2590, U+2588 respectively. unlike Title there is no dither: │ │65 +// U+0020, U+258C, U+2590, U+2588 respectively. unlike Title there are no scanlines:│ │66 // at this height every sub-pixel renders, which keeps the shorter glyphs │ │67 // legible. │ │68 │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/ui/Title.zig│ ╰────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │12 │ │13 const Self = @This(); │ │14 │ │15 -pub fn init(arena: *std.heap.ArenaAllocator, orig_content: []const u8) !Self { │ │15 +pub const Style = enum { solid, scanlines }; │ │16 + │ │17 +pub fn init(arena: *std.heap.ArenaAllocator, orig_content: []const u8, style: Style) !Self {│ │18 return .{ │ │17 - .content = try renderTitle(arena.allocator(), orig_content), │ │19 + .content = try renderTitle(arena.allocator(), orig_content, style), │ │20 }; │ │21 } │ │22 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │62 } │ │63 }; │ │64 │ │63 -// 3-row sextant title font with row-aligned dither. │ │65 +// 3-row sextant title font, optionally with scanlines. │ │66 // │ │67 // each glyph is a 6x9 sub-pixel bitmap that renders as a 3x3 grid of │ │68 // sextant-block characters (U+1FB00-1FB3B). the four 2x3 patterns that│ ╰───────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │522 }; │ │523 } │ │524 │ │523 -fn renderTitle(allocator: std.mem.Allocator, input: []const u8) ![]const u8 { │ │525 +fn renderTitle(allocator: std.mem.Allocator, input: []const u8, style: Style) ![]const u8 {│ │526 var rows: [3]std.ArrayList(u8) = .{ .empty, .empty, .empty }; │ │527 defer for (&rows) |*r| r.deinit(allocator); │ │528 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │530 for (input) |c| { │ │531 const glyph = glyphFor(c) orelse continue; │ │532 │ │531 - // row-aligned dither: keep on-pixels only at even bitmap rows.│ │533 + // scanlines: keep on-pixels only at even bitmap rows. │ │534 var kept: [9][6]bool = std.mem.zeroes([9][6]bool); │ │535 for (0..9) |r| { │ │534 - if (r % 2 != 0) continue; │ │536 + if (style == .scanlines and r % 2 != 0) continue; │ │537 for (0..6) |col| { │ │538 kept[r][col] = glyph[r][col] == '#'; │ │539 } │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/User/Header.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │23 pub fn init(arena: *std.heap.ArenaAllocator, name: []const u8) !Self {│ │24 return .{ │ │25 .name = name, │ │26 - .title = try ui.Title.init(arena, name), │ │26 + .title = try ui.Title.init(arena, name, .scanlines), │ │27 }; │ │28 } │ │29 │ ╰──────────────────────────────────────────────────────────────────────────╯