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 += ``;