1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Use font from the settings

This commit is contained in:
Benjamin Beganović 2021-10-27 16:45:50 +02:00
parent f4979fb0a4
commit 8552431678
2 changed files with 3 additions and 3 deletions

View File

@ -274,7 +274,7 @@ class Helpers
public static function resolveFont(string $font = 'Arial'): array
{
return $font
? ['name' => $font, 'url' => sprintf('https://fonts.googleapis.com/css2?family=%s&display=swap', $font)]
? ['name' => str_replace('_', ' ', $font), 'url' => sprintf('https://fonts.googleapis.com/css2?family=%s&display=swap', str_replace('_', '+', $font))]
: ['name' => 'Arial', 'url' => ''];
}
}

View File

@ -445,8 +445,8 @@ class HtmlEngine
$data['_rate3'] = ['value' => '', 'label' => ctrans('texts.tax')];
$data['$font_size'] = ['value' => $this->settings->font_size . 'px', 'label' => ''];
$data['$font_name'] = ['value' => Helpers::resolveFont()['name'], 'label' => ''];
$data['$font_url'] = ['value' => Helpers::resolveFont()['url'], 'label' => ''];
$data['$font_name'] = ['value' => Helpers::resolveFont($this->settings->primary_font)['name'], 'label' => ''];
$data['$font_url'] = ['value' => Helpers::resolveFont($this->settings->primary_font)['url'], 'label' => ''];
$data['$invoiceninja.whitelabel'] = ['value' => 'https://raw.githubusercontent.com/invoiceninja/invoiceninja/v5-develop/public/images/new_logo.png', 'label' => ''];