Update from front end rendering to support font sizes with units

[MAILPOET-5139]
This commit is contained in:
Rostislav Wolny
2023-03-20 13:10:50 +01:00
committed by Aschepikov
parent ce41438d65
commit 274a77ea92
8 changed files with 51 additions and 6 deletions

View File

@@ -188,8 +188,8 @@ class BlockRendererHelper {
public function renderFontStyle(array $formSettings, array $styles = []) {
$rules = [];
if (isset($formSettings['fontSize'])) {
$rules[] = 'font-size: ' . trim($formSettings['fontSize']) . 'px;';
$rules[] = 'line-height: ' . (float)trim($formSettings['fontSize']) * 1.2 . 'px";';
$rules[] = 'font-size: ' . $formSettings['fontSize'] . (is_numeric($formSettings['fontSize']) ? "px;" : ";");
$rules[] = 'line-height: 1.2;';
}
if (isset($styles['bold'])) {
$rules[] = 'font-weight: bold;';