$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;
}