Hello,
When working with addHeading, some default styles are added is they are not set (bold, keepLines, keepNext, widowControl, sz and font).
You have two approaches to accoomplish what you need: use addText an the headingLevel option or overwrite the default values when callin addHeading.
This is a simple sample of both options
<?php
require_once 'classes/CreateDocx.inc';
$docx = new CreateDocx();
// style options
$style = array(
'font' => 'Verdana',
'fontSize' => '28',
);
//Create custom style
$docx->createParagraphStyle('myStyle', $style);
$text = 'Sample heading.';
$docx->addHeading($text, 1, array('pStyle' => 'myStyle', 'fontSize' => '14', 'font' => 'Verdana'));
$text = 'Sample paragraph.';
$docx->addText($text, array('pStyle' => 'myStyle', 'headingLevel' => 1));
$docx->addText('Other paragraph');
$docx->createDocx('output');
Regards.