From: Vincent Vanwaelscappel Date: Thu, 21 Sep 2023 07:59:04 +0000 (+0200) Subject: wip #4214 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=22eb31a4043ac248524ed8ac0e793e3d94057941;p=fluidbook_tools.git wip #4214 --- diff --git a/src/Links/TextLink.php b/src/Links/TextLink.php index 9b1d2a1..96a24d0 100644 --- a/src/Links/TextLink.php +++ b/src/Links/TextLink.php @@ -8,13 +8,18 @@ class TextLink extends ContentLink { public function getCSS() { - $font = $this->compiler->addFont($this->image); - if (!$font['capHeight']) { - $font['capHeight'] = 1; - } - $fz = $this->height * $this->getCssScale(); - $fz = round($fz / $font['capHeight'], 2); $res = parent::getCSS(); + $fz = $this->height * $this->getCssScale(); + $font['capHeight'] = 1; + if ($this->image) { + $font = $this->compiler->addFont($this->image); + if (!$font['capHeight']) { + $font['capHeight'] = 1; + } + $fz = round($fz / $font['capHeight'], 2); + } else { + $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; }