Creates a new Word character style.

public createCharacterStyle ( string $name [, array $styleOptions = array() ])

This method allows the generation of custom character styles that may be later used in combination with, for example, the addText method.



A string with the name of the Word style that you are creating.


This is an array including all the available styling options.

Key Type Description
bold bool If true the text will be shown in bold characters.
caps bool If true displays text in capital letters.
characterBorder array Adds a border to the character. Keys and values: 'type' => none, single, double, dashed..., 'color' => ffffff, ff0000, 'spacing'=> 0, 1, 2..., 'width' => in eights of a point.
color string Hexadecimal color value: 'FF0000', '000000'...
doubleStrikeThrough bool If true displays text in doubleStrikeThrough.
em string Emphasis mark type: 'none', 'dot', 'circle', 'comma', 'underDot'
font string Font family: 'Arial', Calibri'...
fontSize int Text size in half-points: 8, 9, 10... Multiply by 2 to get the same size as using the fontSize property with addText and other methods.
italic bool If true displays the text in italics.
position int Position value. Positive value for raised and negative value for lowered.
strikeThrough bool If true displays text in strikethrough.
subscript bool If true displays text in subscript.
superscript bool If true displays text in superscript.
underline string Underlines text. Possible values are: 'single', 'words', 'double', 'dotted', 'dash' and 'wave'.
vanish bool Uses a vanish style.
Code samples

Example #1

The resulting Word document looks like: