diff --git a/lib/documents.js b/lib/documents.js index dde771a..032235f 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -637,22 +637,27 @@ const RC = { // motif that gives every section a confident, consistent anchor. function cvHeading(doc, S, dry, cur, title, ruleRight) { const pt = 10.5; + const cs = 0.9 * S; cur.y += 3.6 * S; doc.setFont('Lato', 'bold'); doc.setFontSize(pt * S); + const label = String(title).toUpperCase(); const lineY = cur.y + pt * S * PT * 1.08; if (!dry) { - doc.setCharSpace(0.9 * S); + doc.setCharSpace(cs); doc.setTextColor(RC.accent[0], RC.accent[1], RC.accent[2]); - doc.text(String(title).toUpperCase(), RV.mx, cur.y + pt * S * PT * 0.76); + doc.text(label, RV.mx, cur.y + pt * S * PT * 0.76); doc.setCharSpace(0); const right = ruleRight || RV_R; + // Thick accent segment runs exactly as wide as the heading word (charSpace + // adds one gap after every glyph), the thin hairline continues to the edge. + const wordW = doc.getTextWidth(label) + cs * label.length; doc.setDrawColor(RC.hair[0], RC.hair[1], RC.hair[2]); doc.setLineWidth(0.3 * S); doc.line(RV.mx, lineY, right, lineY); doc.setDrawColor(RC.accent[0], RC.accent[1], RC.accent[2]); doc.setLineWidth(1.0 * S); - doc.line(RV.mx, lineY, Math.min(RV.mx + 15 * S, right), lineY); + doc.line(RV.mx, lineY, Math.min(RV.mx + wordW, right), lineY); } cur.y += pt * S * PT + 4.0 * S; }