From 529aa947e161cfc9e212f10840956da75fa29591 Mon Sep 17 00:00:00 2001 From: gator Date: Sun, 16 Aug 2026 15:32:32 +0000 Subject: [PATCH] footprint: fit each pad label to its pad MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With real geometry in, a fixed label size turns multi-character names on fine-pitch pads into overlapping mush — USB-C's A1/B12 row was unreadable. Scale per pad instead, bounded by both the pad width (divided across the label) and its height. --- assets/part.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/part.js b/assets/part.js index 1bfcf6a..d9b5601 100644 --- a/assets/part.js +++ b/assets/part.js @@ -22,7 +22,13 @@ function footprintSVG(p) { // EasyEDA names a round pad ELLIPSE; OVAL/ROUND are the KiCad-side spellings. const round = /OVAL|ROUND|ELLIPSE|CIRCLE/.test((d.shape || '').toUpperCase()); s += ``; - if (d.n != null) s += `${esc(d.n)}`; + // Fit the label to its pad. A fixed size turns multi-character names on fine-pitch + // pads (USB-C's A1/B12) into overlapping mush, so narrow pads get smaller text. + if (d.n != null) { + const lab = String(d.n); + const pf = Math.min(fs, (d.w * 1.7) / Math.max(lab.length, 1), d.h * 0.95); + s += `${esc(lab)}`; + } } if (p.class === 'connector') { // board-edge marker on the mating side s += ``;