]> _ Git - fluidbook_tools.git/commitdiff
wait #5393
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 24 Nov 2023 15:36:20 +0000 (16:36 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 24 Nov 2023 15:36:20 +0000 (16:36 +0100)
src/Links/TextLink.php

index 96a24d09071348bcbb3cafaa912e189e3cc1ea2a..9c8c8ccb7139ff8b1bbdabc02fe89ca8a1e44909 100644 (file)
@@ -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;
     }