From 442ee6f960d0115069a31c290f109833bafd5567 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sun, 17 May 2026 16:21:11 -0400 Subject: [PATCH] Shrink font further on long ward-leader names The card's name font size was just 22px down to 20px once names reached 28 characters, which isn't small enough for names like 'Katherine Gilmore-Richardson' (the 'K' was getting clipped at the left edge of the card, per #311). Step it down further: 18px at 28+, 16px at 32+, so the longest names still fit inside the card. Closes #311. Signed-off-by: Charlie Tonneslan --- src/components/baseball-card/svg.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/baseball-card/svg.js b/src/components/baseball-card/svg.js index f8fb6aaa..54db51f9 100644 --- a/src/components/baseball-card/svg.js +++ b/src/components/baseball-card/svg.js @@ -83,7 +83,17 @@ export function createFront(el, data) { const nameWidth = config.cardWidth - 19; const nameHeight = config.cardHeight - 17; - const nameFontSize = data.name.length < 28 ? 22 : 20; + // Shrink the font on longer names so hyphenated double-barrelled names + // like "Katherine Gilmore-Richardson" don't get cut off at the left edge + // of the card (see #311). + const nameFontSize = + data.name.length < 24 + ? 22 + : data.name.length < 28 + ? 20 + : data.name.length < 32 + ? 18 + : 16; const nameText = svg.text(nameWidth, nameHeight, data.name).attr({ "text-anchor": "end", fill: config.cardBorderColor,