From 22eb31a4043ac248524ed8ac0e793e3d94057941 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 21 Sep 2023 09:59:04 +0200 Subject: [PATCH] wip #4214 --- src/Links/TextLink.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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; } -- 2.39.5