tranlate percentage to rate
This commit is contained in:
parent
fe3f383621
commit
97d60dd985
|
|
@ -18,6 +18,9 @@ $html .= '<p lang="he-IL" style="text-align: right; direction: rtl">היי, זה
|
|||
$html .= '<p style="margin-top: 240pt;">Unordered (bulleted) list:</p>';
|
||||
$html .= '<ul><li>Item 1</li><li>Item 2</li><ul><li>Item 2.1</li><li>Item 2.1</li></ul></ul>';
|
||||
|
||||
$html .= '<p style="margin-top: 240pt;">1.5 line height with first line text indent:</p>';
|
||||
$html .= '<p style="text-align: justify; text-indent: 70.9pt; line-height: 150%;">Lorem ipsum dolor sit amet, <strong>consectetur adipiscing elit</strong>, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>';
|
||||
|
||||
$html .= '<h2 style="align: center">centered title</h2>';
|
||||
|
||||
$html .= '<p style="margin-top: 240pt;">Ordered (numbered) list:</p>';
|
||||
|
|
|
|||
|
|
@ -521,7 +521,7 @@ class Html
|
|||
$styles['bgColor'] = trim($cValue, '#');
|
||||
break;
|
||||
case 'line-height':
|
||||
$styles['lineHeight'] = $cValue;
|
||||
$styles['lineHeight'] = Html::toMultiplier($cValue);
|
||||
break;
|
||||
case 'text-indent':
|
||||
$styles['indentation']['firstLine'] = Converter::cssToTwip($cValue);
|
||||
|
|
@ -681,6 +681,15 @@ class Html
|
|||
return null;
|
||||
}
|
||||
|
||||
private static function toMultiplier($cssValue)
|
||||
{
|
||||
if (preg_match('/([0-9]+)%/', $cssValue, $matches)) {
|
||||
return ((int) $matches[1]) / 100;
|
||||
}
|
||||
|
||||
return $cssValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse line break
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue