Hello,
We have run the following code:
$docx = new CreateDocx();
$docx->createListStyle('inclusion', [
0 => [
'type' => 'decimal', // ordered list
'align' => 'right', // align numbers to the right
'fontSize' => 10, // this seems to be ignored
'font' => 'Calibri',
'suff' => 'space', // space between list number and text
],
]);
// list items
$myList = array('item 1', array('subitem 1.1', 'subitem 1.2'), 'item 2');
// insert the custom list into the Word document
$docx->addList($myList, 'inclusion');
$docx->createDocx('output');
and the output is correct in all MS Word versions and LibreOffice.
If we set a higher value, the output is correct too:
$docx = new CreateDocx();
$docx->createListStyle('inclusion', [
0 => [
'type' => 'decimal', // ordered list
'align' => 'right', // align numbers to the right
'fontSize' => 16, // this seems to be ignored
'font' => 'Calibri',
'suff' => 'space', // space between list number and text
],
]);
// list items
$myList = array('item 1', array('subitem 1.1', 'subitem 1.2'), 'item 2');
// insert the custom list into the Word document
$docx->addList($myList, 'inclusion');
$docx->createDocx('output');
Please note that this fontSize option sets the font size of the item list (bullet, decimal...), not the text content. To set styles of the text contents in a list you need to use WordFragments, please check the included sample: Core/addList/sample_3.php.
Regards.