Fix overlapping text on card backs by increasing line spacing
Increased line height from 3.8 to 9.5 points for the small text at the bottom of card backs to prevent text overlap when song titles and artist names wrap to multiple lines. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
bea985066a
commit
887b1b8d2e
1 file changed
+3
-2
@@ -193,9 +193,10 @@ def draw_card_back(c: canvas.Canvas, x: float, y: float, card: TrackCard):
|
||||
label = f"{card.title} — {card.artists}"
|
||||
text_w = CARD_W - 2 * pad
|
||||
lines = wrap_text(label, text_w, "Helvetica", 8, c)
|
||||
base_y = y + pad + (len(lines) - 1) * 3.8
|
||||
line_height = 9.5
|
||||
base_y = y + pad + (len(lines) - 1) * line_height
|
||||
for i, line in enumerate(lines[:3]):
|
||||
c.drawCentredString(x + CARD_W / 2.0, base_y - i * 3.8, line)
|
||||
c.drawCentredString(x + CARD_W / 2.0, base_y - i * line_height, line)
|
||||
|
||||
def build_cards(tracks: List[dict], qr_size_mm: float) -> List[TrackCard]:
|
||||
cards: List[TrackCard] = []
|
||||
|
||||
Reference in new issue
Block a user