From 9bad0873e9209eae68beb72276571bebc7386885 Mon Sep 17 00:00:00 2001 From: Dave Shoreman Date: Wed, 24 Apr 2024 15:12:03 +0100 Subject: [PATCH] Fix secondary fonts for Invoice Design preview If a secondary font is used in the Invoice Design settings, it works in the Custom Design editor, but the preview in General Settings always shows Roboto in place of the secondary font, regardless of settings. This updates PdfMock to also support secondary fonts on the main tab. --- app/Services/Pdf/PdfMock.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Services/Pdf/PdfMock.php b/app/Services/Pdf/PdfMock.php index 1afc3ef8a49b..4d7f6a7a50dc 100644 --- a/app/Services/Pdf/PdfMock.php +++ b/app/Services/Pdf/PdfMock.php @@ -154,7 +154,7 @@ class PdfMock $entity->tax_map = $this->getTaxMap(); $entity->total_tax_map = $this->getTotalTaxMap(); $entity->invitation->company = $this->company; - + return $entity; } @@ -242,6 +242,7 @@ class PdfMock '$company.postal_code' => $this->settings->postal_code, '$client.billing_city' => 'Aufderharchester', '$secondary_font_name' => isset($this->settings?->secondary_font) ? $this->settings->secondary_font : 'Roboto', + '$secondary_font_url' => isset($this->settings?->secondary_font) ? \App\Utils\Helpers::resolveFont($this->settings->secondary_font)['url'] : 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', '$product.line_total' => '', '$product.tax_amount' => '', '$company.vat_number' => $this->settings->vat_number, @@ -249,7 +250,6 @@ class PdfMock '$quote.quote_number' => '0029', '$client.postal_code' => '11243', '$contact.first_name' => 'Benedict', - '$secondary_font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap', '$contact.signature' => '', '$company_logo_size' => $this->settings->company_logo_size ?: '65%', '$product.tax_rate1' => ctrans('texts.tax'), @@ -994,7 +994,7 @@ class PdfMock
- +
@@ -1028,7 +1028,7 @@ class PdfMock
- +
@@ -1059,7 +1059,7 @@ class PdfMock
- +
@@ -1094,7 +1094,7 @@ class PdfMock
- +