From f7ec6c69d35959c23cec063929e3c7d3ee200fa8 Mon Sep 17 00:00:00 2001 From: Daniel Hammer Date: Mon, 6 Jul 2026 21:26:29 +0200 Subject: [PATCH] feat: enlarge and vertically center charmap footer text Bump the selected character's name (16->19) and metadata (14->15) sizes, and lay them out as a two-line block vertically centered on the preview glyph box instead of top-aligned. Co-Authored-By: Claude Opus 4.8 --- programs/src/charmap/main.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/programs/src/charmap/main.cpp b/programs/src/charmap/main.cpp index 53ca77e..4ba870d 100644 --- a/programs/src/charmap/main.cpp +++ b/programs/src/charmap/main.cpp @@ -207,8 +207,8 @@ static constexpr int CELL_TARGET = 54; // desired tile edge in px static constexpr int CELL_SIZE = 26; // glyph font size inside a tile static constexpr int PREVIEW_SIZE = 40; -static constexpr int NAME_SIZE = 16; -static constexpr int META_SIZE = 14; +static constexpr int NAME_SIZE = 19; +static constexpr int META_SIZE = 15; static constexpr uint64_t COPIED_MS = 1600; @@ -409,15 +409,20 @@ static void render(Canvas& c) { g_theme.radius_md - 1, colors::WHITE); draw_centered_glyph(c, preview, sg.byte, g_theme.text, PREVIEW_SIZE); - // Name + metadata. + // Name + metadata, as a two-line block vertically centered on the preview. int cp = codepoint_of(sg.byte); int text_x = preview.x + preview.w + 14; - draw_text(c, title_font, text_x, L.footer.y + 16, sg.name, - g_theme.text, NAME_SIZE); char meta[64]; snprintf(meta, sizeof(meta), "U+%04X dec %d Alt 0%d", cp, cp, (int)sg.byte); - draw_text(c, fonts::system_font, text_x, L.footer.y + 16 + NAME_SIZE + 8, + + int name_h = text_height(title_font, NAME_SIZE); + int meta_h = text_height(fonts::system_font, META_SIZE); + int line_gap = 6; + int block_y = preview.y + (preview.h - (name_h + line_gap + meta_h)) / 2; + + draw_text(c, title_font, text_x, block_y, sg.name, g_theme.text, NAME_SIZE); + draw_text(c, fonts::system_font, text_x, block_y + name_h + line_gap, meta, g_theme.text_subtle, META_SIZE); // Copy button — canonical MTK primary button, like other Montauk apps.