fix: separate handset icon (landline) and smartphone icon (mobile) in PDF export

- Landline phone: classic telephone handset with earpiece, mouthpiece and curved connector
- Mobile phone: smartphone outline with display and home button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Reitz 2026-03-09 12:17:47 +01:00
parent 82af9cb1f0
commit 0c195dc3a9

View file

@ -175,11 +175,11 @@ export class ProfileExportService {
const iconTextOffset = 18; // Abstand Icon → Text const iconTextOffset = 18; // Abstand Icon → Text
if (data.phone) { if (data.phone) {
this.drawPhoneIcon(doc, leftColX + 1, yLeft, accentColor); this.drawHandsetIcon(doc, leftColX + 1, yLeft, accentColor);
yLeft = this.pdfContactText(doc, data.phone, leftColX + iconTextOffset, yLeft, leftColWidth - iconTextOffset); yLeft = this.pdfContactText(doc, data.phone, leftColX + iconTextOffset, yLeft, leftColWidth - iconTextOffset);
} }
if (data.mobile) { if (data.mobile) {
this.drawPhoneIcon(doc, leftColX + 1, yLeft, accentColor); this.drawMobileIcon(doc, leftColX + 1, yLeft, accentColor);
yLeft = this.pdfContactText(doc, data.mobile, leftColX + iconTextOffset, yLeft, leftColWidth - iconTextOffset); yLeft = this.pdfContactText(doc, data.mobile, leftColX + iconTextOffset, yLeft, leftColWidth - iconTextOffset);
} }
if (data.email) { if (data.email) {
@ -731,7 +731,27 @@ export class ProfileExportService {
// --- Vektor-Icons für Kontakt --- // --- Vektor-Icons für Kontakt ---
private drawPhoneIcon(doc: PDFKit.PDFDocument, x: number, y: number, color: string): void { private drawHandsetIcon(doc: PDFKit.PDFDocument, x: number, y: number, color: string): void {
doc.save();
// Klassischer Telefonhörer (Festnetz)
// Hörer-Form: oben Ohrmuschel, unten Sprechmuschel, verbunden durch Bogen
const cx = x + 4;
// Ohrmuschel (oben) — abgerundetes Rechteck
doc.roundedRect(cx - 3.5, y - 0.5, 7, 3, 1.2).fill(color);
// Sprechmuschel (unten) — abgerundetes Rechteck
doc.roundedRect(cx - 3.5, y + 7, 7, 3, 1.2).fill(color);
// Verbindungsbogen (links) zwischen Ohr- und Sprechmuschel
doc.moveTo(cx - 2, y + 2.5)
.bezierCurveTo(cx - 5, y + 4, cx - 5, y + 5.5, cx - 2, y + 7)
.strokeColor(color).lineWidth(2.2).stroke();
doc.restore();
}
private drawMobileIcon(doc: PDFKit.PDFDocument, x: number, y: number, color: string): void {
doc.save(); doc.save();
// Smartphone-Icon: abgerundetes Rechteck mit Display und Home-Button // Smartphone-Icon: abgerundetes Rechteck mit Display und Home-Button
const w = 7; const w = 7;