Smallcaps

Jan 25, 2014 at 9:09 AM
Smallcaps are not yet implemented but they're an easy task:

in PHPWord/Style/Font.php add:
// after private $_fgColor;
private $_smallCaps; 
...
// in __construct(...) after $this->_fgColor = null;
$this->_smallCaps = null; 

// at the end of the PHPWord_Style_Font class add methods:

public function getSmallcaps() {
    return $this->_smallCaps;
}

public function setSmallcaps($pValue = false) {
    if($pValue == '') {
        $pValue = false;
    }
    $this->_smallCaps = $pValue;
    return $this;
}
In PHPWord/Writer/Word2007/Base.php add:
// in function function _writeTextStyle,
// after $underline = $style->getUnderline();

$smallcaps = $style->getSmallcaps();

// in function function _writeTextStyle
//after if ($font != 'Arial') {...} add;

//Smallcaps
if(!is_null($smallcaps)) {
    $objWriter->startElement('w:smallCaps');
    $objWriter->writeAttribute('w:val', $smallcaps);
    $objWriter->endElement();
}
That's all!
Mar 20, 2014 at 5:24 AM
I've submitted your enhancement request. Thanks.