Skip to content

Commit

Permalink
try to find font files inside yetiforceCRM public_html dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalpospiech committed Jan 2, 2019
1 parent d5769b8 commit 2bbc011
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/Objects/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,21 @@ protected function matchFont(bool $custom = false)
public function getFontFileName()
{
if (isset(static::$fontFiles[$this->family])) {
return $this->fontDir . $this->matchFont();
$match = $this->matchFont();
if (file_exists($this->fontDir . $match)) {
return $this->fontDir . $match;
}
if (defined('ROOT_DIRECTORY')) {
$path = ROOT_DIRECTORY;
$path .= DIRECTORY_SEPARATOR . 'public_html';
$path .= DIRECTORY_SEPARATOR . 'vendor';
$path .= DIRECTORY_SEPARATOR . 'yetiforce';
$path .= DIRECTORY_SEPARATOR . 'yetiforcepdf';
$path .= DIRECTORY_SEPARATOR . 'lib';
$path .= DIRECTORY_SEPARATOR . 'Fonts';
$path .= DIRECTORY_SEPARATOR . $match;
return $path;
}
}
if (isset(static::$customFontFiles[$this->family])) {
return $this->matchFont(true);
Expand Down

0 comments on commit 2bbc011

Please sign in to comment.