Merge pull request #1764 from mdupont/358-paragraph-indent

fix: documentation about paragraph indentation
This commit is contained in:
troosan 2019-12-08 13:28:35 +01:00 committed by GitHub
commit 9020e6769e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -75,8 +75,10 @@ Available Paragraph style options:
- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. - ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012.
See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values. See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values.
- ``basedOn``. Parent style. - ``basedOn``. Parent style.
- ``hanging``. Hanging in *twip*. - ``hanging``. Hanging indentation in *half inches*.
- ``indent``. Indent in *twip*. - ``indent``. Indent (left indentation) in *half inches*.
- ``indentation``. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine* and *hanging* indentation.
See ``\PhpOffice\PhpWord\Style\Indentation`` for possible identation types.
- ``keepLines``. Keep all lines on one page, *true* or *false*. - ``keepLines``. Keep all lines on one page, *true* or *false*.
- ``keepNext``. Keep paragraph with next paragraph, *true* or *false*. - ``keepNext``. Keep paragraph with next paragraph, *true* or *false*.
- ``lineHeight``. Text line height, e.g. *1.0*, *1.5*, etc. - ``lineHeight``. Text line height, e.g. *1.0*, *1.5*, etc.

View File

@ -198,7 +198,7 @@ class Paragraph extends Border
{ {
$key = Text::removeUnderscorePrefix($key); $key = Text::removeUnderscorePrefix($key);
if ('indent' == $key || 'hanging' == $key) { if ('indent' == $key || 'hanging' == $key) {
$value = $value * 720; $value = $value * 720; // 720 twips is 0.5 inch
} }
return parent::setStyleValue($key, $value); return parent::setStyleValue($key, $value);