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 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 21:26:29 +02:00
parent 4301f39a9e
commit f7ec6c69d3
+11 -6
View File
@@ -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.