1
1
<?php
2
-
3
2
/**
4
3
* PHPWord
5
4
*
25
24
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
26
25
* @version 0.8.0
27
26
*/
27
+
28
+ namespace PhpOffice \PhpWord \Style ;
29
+
28
30
use PhpOffice \PhpWord \Exceptions \InvalidStyleException ;
29
31
30
- /**
31
- * Class PHPWord_Style_Font
32
- */
33
- class PHPWord_Style_Font
32
+ class Font
34
33
{
35
34
const UNDERLINE_NONE = 'none ' ;
36
35
const UNDERLINE_DASH = 'dash ' ;
@@ -76,7 +75,7 @@ class PHPWord_Style_Font
76
75
/**
77
76
* Paragraph Style
78
77
*
79
- * @var PHPWord_Style_Paragraph
78
+ * @var PhpOffice\PhpWord\Style\Paragraph
80
79
*/
81
80
private $ _paragraphStyle ;
82
81
@@ -127,7 +126,7 @@ class PHPWord_Style_Font
127
126
*
128
127
* @var string
129
128
*/
130
- private $ _underline = PHPWord_Style_Font ::UNDERLINE_NONE ;
129
+ private $ _underline = self ::UNDERLINE_NONE ;
131
130
132
131
/**
133
132
* Strikethrough
@@ -174,10 +173,10 @@ public function __construct($type = 'text', $paragraphStyle = null)
174
173
{
175
174
$ this ->_type = $ type ;
176
175
177
- if ($ paragraphStyle instanceof PHPWord_Style_Paragraph ) {
176
+ if ($ paragraphStyle instanceof Paragraph ) {
178
177
$ this ->_paragraphStyle = $ paragraphStyle ;
179
178
} elseif (is_array ($ paragraphStyle )) {
180
- $ this ->_paragraphStyle = new PHPWord_Style_Paragraph ;
179
+ $ this ->_paragraphStyle = new Paragraph ;
181
180
$ this ->_paragraphStyle ->setArrayStyle ($ paragraphStyle );
182
181
} else {
183
182
$ this ->_paragraphStyle = $ paragraphStyle ;
@@ -230,8 +229,8 @@ public function getName()
230
229
/**
231
230
* Set font name
232
231
*
233
- * @param string $pValue
234
- * @return PHPWord_Style_Font
232
+ * @param string $pValue
233
+ * @return PhpOffice\PhpWord\Style\Font
235
234
*/
236
235
public function setName ($ pValue = PHPWord::DEFAULT_FONT_NAME )
237
236
{
@@ -256,8 +255,8 @@ public function getSize()
256
255
/**
257
256
* Set font size
258
257
*
259
- * @param int|float $pValue
260
- * @return PHPWord_Style_Font
258
+ * @param int|float $pValue
259
+ * @return PhpOffice\PhpWord\Style\Font
261
260
*/
262
261
public function setSize ($ pValue = PHPWord::DEFAULT_FONT_SIZE )
263
262
{
@@ -281,8 +280,8 @@ public function getBold()
281
280
/**
282
281
* Set bold
283
282
*
284
- * @param bool $pValue
285
- * @return PHPWord_Style_Font
283
+ * @param bool $pValue
284
+ * @return PhpOffice\PhpWord\Style\Font
286
285
*/
287
286
public function setBold ($ pValue = false )
288
287
{
@@ -306,8 +305,8 @@ public function getItalic()
306
305
/**
307
306
* Set italics
308
307
*
309
- * @param bool $pValue
310
- * @return PHPWord_Style_Font
308
+ * @param bool $pValue
309
+ * @return PhpOffice\PhpWord\Style\Font
311
310
*/
312
311
public function setItalic ($ pValue = false )
313
312
{
@@ -331,8 +330,8 @@ public function getSuperScript()
331
330
/**
332
331
* Set superscript
333
332
*
334
- * @param bool $pValue
335
- * @return PHPWord_Style_Font
333
+ * @param bool $pValue
334
+ * @return PhpOffice\PhpWord\Style\Font
336
335
*/
337
336
public function setSuperScript ($ pValue = false )
338
337
{
@@ -357,8 +356,8 @@ public function getSubScript()
357
356
/**
358
357
* Set subscript
359
358
*
360
- * @param bool $pValue
361
- * @return PHPWord_Style_Font
359
+ * @param bool $pValue
360
+ * @return PhpOffice\PhpWord\Style\Font
362
361
*/
363
362
public function setSubScript ($ pValue = false )
364
363
{
@@ -383,13 +382,13 @@ public function getUnderline()
383
382
/**
384
383
* Set underline
385
384
*
386
- * @param string $pValue
387
- * @return PHPWord_Style_Font
385
+ * @param string $pValue
386
+ * @return PhpOffice\PhpWord\Style\Font
388
387
*/
389
- public function setUnderline ($ pValue = PHPWord_Style_Font ::UNDERLINE_NONE )
388
+ public function setUnderline ($ pValue = self ::UNDERLINE_NONE )
390
389
{
391
390
if ($ pValue == '' ) {
392
- $ pValue = PHPWord_Style_Font ::UNDERLINE_NONE ;
391
+ $ pValue = self ::UNDERLINE_NONE ;
393
392
}
394
393
$ this ->_underline = $ pValue ;
395
394
return $ this ;
@@ -408,8 +407,8 @@ public function getStrikethrough()
408
407
/**
409
408
* Set strikethrough
410
409
*
411
- * @param bool $pValue
412
- * @return PHPWord_Style_Font
410
+ * @param bool $pValue
411
+ * @return PhpOffice\PhpWord\Style\Font
413
412
*/
414
413
public function setStrikethrough ($ pValue = false )
415
414
{
@@ -433,8 +432,8 @@ public function getColor()
433
432
/**
434
433
* Set font color
435
434
*
436
- * @param string $pValue
437
- * @return PHPWord_Style_Font
435
+ * @param string $pValue
436
+ * @return PhpOffice\PhpWord\Style\Font
438
437
*/
439
438
public function setColor ($ pValue = PHPWord::DEFAULT_FONT_COLOR )
440
439
{
@@ -458,8 +457,8 @@ public function getFgColor()
458
457
/**
459
458
* Set foreground/highlight color
460
459
*
461
- * @param string $pValue
462
- * @return PHPWord_Style_Font
460
+ * @param string $pValue
461
+ * @return PhpOffice\PhpWord\Style\Font
463
462
*/
464
463
public function setFgColor ($ pValue = null )
465
464
{
@@ -480,7 +479,7 @@ public function getStyleType()
480
479
/**
481
480
* Get paragraph style
482
481
*
483
- * @return PHPWord_Style_Paragraph
482
+ * @return PhpOffice\PhpWord\Style\Paragraph
484
483
*/
485
484
public function getParagraphStyle ()
486
485
{
@@ -530,8 +529,8 @@ public function getHint()
530
529
/**
531
530
* Set Font Content Type
532
531
*
533
- * @param string $pValue
534
- * @return PHPWord_Style_Font
532
+ * @param string $pValue
533
+ * @return PhpOffice\PhpWord\Style\Font
535
534
*/
536
535
public function setHint ($ pValue = PHPWord::DEFAULT_FONT_CONTENT_TYPE )
537
536
{
0 commit comments