@@ -43,6 +43,15 @@ class RichText extends AbstractShape implements ComparableInterface
43
43
/** Overflow */
44
44
public const OVERFLOW_CLIP = 'clip ' ;
45
45
public const OVERFLOW_OVERFLOW = 'overflow ' ;
46
+
47
+ /** Vertical alignment */
48
+ const VALIGN_TOP = 't ' ;
49
+ const VALIGN_MIDDLE = 'ctr ' ;
50
+ const VALIGN_BOTTOM = 'b ' ;
51
+
52
+ /** Vertical alignment center */
53
+ const VALIGN_CENTER = 1 ;
54
+ const VALIGN_NOTCENTER = 0 ;
46
55
47
56
/**
48
57
* Rich text paragraphs.
@@ -169,6 +178,17 @@ class RichText extends AbstractShape implements ComparableInterface
169
178
* @var null|float
170
179
*/
171
180
private $ lnSpcReduction ;
181
+
182
+ /**
183
+ * Define vertical text position into shape (top,center,bottom)
184
+ * @var string
185
+ */
186
+ private $ verticalAlign = self ::VALIGN_TOP ;
187
+ /**
188
+ * Define vertical text center position into shape (center,not center)
189
+ * @var int
190
+ */
191
+ private $ verticalAlignCenter = self ::VALIGN_NOTCENTER ;
172
192
173
193
/**
174
194
* Create a new \PhpOffice\PhpPresentation\Shape\RichText instance.
@@ -486,6 +506,59 @@ public function setVertical(bool $value = false): self
486
506
487
507
return $ this ;
488
508
}
509
+
510
+ /**
511
+ * Define the vertical alignment
512
+ *
513
+ * @param string|null $value top,center,bottom
514
+ * @return $this
515
+ * @see self::VALIGN_TOP, self::VALIGN_MIDLE, self::VALIGN_BOTTOM
516
+ */
517
+ public function setVerticalAlignment (?string $ value )
518
+ {
519
+ if (isset ($ value )) {
520
+ $ this ->verticalAlign = $ value ;
521
+ } else {
522
+ $ this ->verticalAlign = self ::VALIGN_TOP ;
523
+ }
524
+ return $ this ;
525
+ }
526
+
527
+ /**
528
+ * Get the vertical alignment
529
+ *
530
+ * @return string
531
+ * @see self::VALIGN_TOP, self::VALIGN_MIDLE, self::VALIGN_BOTTOM
532
+ */
533
+ public function getVerticalAlignment ():string
534
+ {
535
+ return $ this ->verticalAlign ;
536
+ }
537
+
538
+ /**
539
+ * Define the vertical alignment if centered or not
540
+ * @param int|null $value 1=center 0=not center
541
+ * @return $this
542
+ * @see self::VALIGN_CENTER, self::VALIGN_NOTCENTER
543
+ */
544
+ public function setVerticalAlignCenter (?int $ value )
545
+ {
546
+ if (isset ($ value )) {
547
+ $ this ->verticalAlignCenter = $ value ;
548
+ } else {
549
+ $ this ->verticalAlignCenter = self ::VALIGN_NOTCENTER ;
550
+ }
551
+ return $ this ;
552
+ }
553
+
554
+ /**
555
+ * Get the vertical alignment center
556
+ * @return int
557
+ */
558
+ public function getVerticalAlignCenter ():int
559
+ {
560
+ return $ this ->verticalAlignCenter ;
561
+ }
489
562
490
563
/**
491
564
* Get columns.
0 commit comments