From: Vincent Vanwaelscappel Date: Fri, 24 Nov 2023 15:36:20 +0000 (+0100) Subject: wait #5393 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9d74b725e456b8912e26e4f630b712929c1ffcce;p=fluidbook_tools.git wait #5393 --- diff --git a/src/Links/TextLink.php b/src/Links/TextLink.php index 96a24d0..9c8c8cc 100644 --- a/src/Links/TextLink.php +++ b/src/Links/TextLink.php @@ -12,14 +12,19 @@ class TextLink extends ContentLink $fz = $this->height * $this->getCssScale(); $font['capHeight'] = 1; if ($this->image) { - $font = $this->compiler->addFont($this->image); - if (!$font['capHeight']) { - $font['capHeight'] = 1; + $f = $this->compiler->addFont($this->image); + if (null !== $f) { + $font = $f; + if (!$font['capHeight']) { + $font['capHeight'] = 1; + } + $fz = round($fz / $font['capHeight'], 2); } - $fz = round($fz / $font['capHeight'], 2); - } else { + } + if (!isset($font['family'])) { $font['family'] = 'Arial, Helvetica, sans-serif'; } + $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . Color::colorToCSS($this->extra, 1) . ';'; return $res; }