RichText
extends AbstractShape
in package
implements
ComparableInterface
\PhpOffice\PhpPresentation\Shape\RichText.
Table of Contents
Interfaces
- ComparableInterface
- PhpOffice\PhpPresentation\ComparableInterface.
Constants
- AUTOFIT_DEFAULT = 'spAutoFit'
- Autofit
- AUTOFIT_NOAUTOFIT = 'noAutofit'
- AUTOFIT_NORMAL = 'normAutofit'
- AUTOFIT_SHAPE = 'spAutoFit'
- OVERFLOW_CLIP = 'clip'
- Overflow
- OVERFLOW_OVERFLOW = 'overflow'
- VALIGN_CENTER = 1
- Vertical alignment center
- VALIGN_NOTCENTER = 0
- WRAP_NONE = 'none'
- Wrapping
- WRAP_SQUARE = 'square'
Properties
- $container : null|ShapeContainerInterface
- Container.
- $height : int
- Height.
- $hyperlink : null|Hyperlink
- $name : string
- Name.
- $offsetX : int
- Offset X.
- $offsetY : int
- Offset Y.
- $placeholder : null|Placeholder
- $rotation : int
- Rotation.
- $shadow : null|Shadow
- Shadow.
- $width : int
- Width.
- $activeParagraph : int
- Active paragraph.
- $autoFit : string
- Autofit.
- $autoShrinkHorizontal : null|bool
- Horizontal Auto Shrink.
- $autoShrinkVertical : null|bool
- Vertical Auto Shrink.
- $border : Border
- Border.
- $bottomInset : float
- Bottom inset (in pixels).
- $columns : int
- Number of columns (1 - 16).
- $columnSpacing : int
- The spacing between columns.
- $fill : null|Fill
- $fontScale : null|float
- The percentage of the original font size to which the text is scaled.
- $hashIndex : int
- Hash index.
- $horizontalOverflow : string
- Horizontal overflow.
- $leftInset : float
- Left inset (in pixels).
- $lnSpcReduction : null|float
- The percentage of the reduction of the line spacing.
- $richTextParagraphs : array<string|int, Paragraph>
- Rich text paragraphs.
- $rightInset : float
- Right inset (in pixels).
- $topInset : float
- Top inset (in pixels).
- $upright : bool
- Text upright?
- $vertical : bool
- Vertical text?
- $verticalAlignCenter : int
- Define vertical text center position into shape (center,not center).
- $verticalOverflow : string
- Vertical overflow.
- $wrap : string
- Text wrapping.
Methods
- __clone() : mixed
- Magic Method : clone.
- __construct() : mixed
- Create a new \PhpOffice\PhpPresentation\Shape\RichText instance.
- __toString() : string
- Convert to string.
- addText() : self
- Add text.
- createBreak() : BreakElement
- Create break.
- createParagraph() : Paragraph
- Create paragraph.
- createText() : TextElement
- Create text (can not be formatted !).
- createTextRun() : Run
- Create text run (can be formatted).
- getActiveParagraph() : Paragraph
- getActiveParagraphIndex() : int
- Get active paragraph index.
- getAutoFit() : string
- Get autofit.
- getBorder() : Border
- getColumns() : int
- Get columns.
- getColumnSpacing() : int
- Get spacing between columns.
- getContainer() : ShapeContainerInterface|null
- Get Container, Slide or Group.
- getFill() : Fill|null
- getFontScale() : float|null
- Get pourcentage of fontScale.
- getHashCode() : string
- Get hash code.
- getHashIndex() : null|int
- Get hash index.
- getHeight() : int
- Get Height.
- getHorizontalOverflow() : string
- Get horizontal overflow.
- getHyperlink() : Hyperlink
- Get Hyperlink.
- getInsetBottom() : float
- Get bottom inset.
- getInsetLeft() : float
- Get left inset.
- getInsetRight() : float
- Get right inset.
- getInsetTop() : float
- Get top inset.
- getLineSpaceReduction() : float|null
- Get pourcentage of the line space reduction.
- getName() : string
- Get Name.
- getOffsetX() : int
- Get OffsetX.
- getOffsetY() : int
- Get OffsetY.
- getParagraph() : Paragraph
- Get paragraph.
- getParagraphs() : array<string|int, Paragraph>
- getPlaceholder() : Placeholder|null
- getPlainText() : string
- Get plain text.
- getRotation() : int
- Get Rotation.
- getShadow() : Shadow|null
- getVerticalAlignCenter() : int
- Get the vertical alignment center.
- getVerticalOverflow() : string
- Get vertical overflow.
- getWidth() : int
- Get Width.
- getWrap() : string
- Get text wrapping.
- hasAutoShrinkHorizontal() : bool|null
- hasAutoShrinkVertical() : bool|null
- Set vertical auto shrink.
- hasHyperlink() : bool
- Has Hyperlink?
- isPlaceholder() : bool
- isUpright() : bool
- Get upright.
- isVertical() : bool
- Get vertical.
- setActiveParagraph() : Paragraph
- Set active paragraph.
- setAutoFit() : self
- Set autofit.
- setAutoShrinkHorizontal() : self
- setAutoShrinkVertical() : self
- Set vertical auto shrink.
- setColumns() : self
- Set columns.
- setColumnSpacing() : self
- Set spacing between columns.
- setContainer() : $this
- Set Container, Slide or Group.
- setFill() : self
- setHashIndex() : $this
- Set hash index.
- setHeight() : $this
- Set Height.
- setHorizontalOverflow() : self
- Set horizontal overflow.
- setHyperlink() : self
- Set Hyperlink.
- setInsetBottom() : self
- Set bottom inset.
- setInsetLeft() : self
- Set left inset.
- setInsetRight() : self
- Set left inset.
- setInsetTop() : self
- Set top inset.
- setName() : static
- Set Name.
- setOffsetX() : $this
- Set OffsetX.
- setOffsetY() : $this
- Set OffsetY.
- setParagraphs() : self
- Set paragraphs.
- setPlaceHolder() : self
- setRotation() : $this
- Set Rotation.
- setShadow() : $this
- setUpright() : self
- Set vertical.
- setVertical() : self
- Set vertical.
- setVerticalAlignCenter() : self
- Define the vertical alignment if centered or not.
- setVerticalOverflow() : self
- Set vertical overflow.
- setWidth() : $this
- Set Width.
- setWidthAndHeight() : self
- Set width and height with proportional resize.
- setWrap() : self
- Set text wrapping.
Constants
AUTOFIT_DEFAULT
Autofit
public
mixed
AUTOFIT_DEFAULT
= 'spAutoFit'
AUTOFIT_NOAUTOFIT
public
mixed
AUTOFIT_NOAUTOFIT
= 'noAutofit'
AUTOFIT_NORMAL
public
mixed
AUTOFIT_NORMAL
= 'normAutofit'
AUTOFIT_SHAPE
public
mixed
AUTOFIT_SHAPE
= 'spAutoFit'
OVERFLOW_CLIP
Overflow
public
mixed
OVERFLOW_CLIP
= 'clip'
OVERFLOW_OVERFLOW
public
mixed
OVERFLOW_OVERFLOW
= 'overflow'
VALIGN_CENTER
Vertical alignment center
public
mixed
VALIGN_CENTER
= 1
VALIGN_NOTCENTER
public
mixed
VALIGN_NOTCENTER
= 0
WRAP_NONE
Wrapping
public
mixed
WRAP_NONE
= 'none'
WRAP_SQUARE
public
mixed
WRAP_SQUARE
= 'square'
Properties
$container
Container.
protected
null|ShapeContainerInterface
$container
$height
Height.
protected
int
$height
$hyperlink
protected
null|Hyperlink
$hyperlink
$name
Name.
protected
string
$name
= ''
$offsetX
Offset X.
protected
int
$offsetX
$offsetY
Offset Y.
protected
int
$offsetY
$placeholder
protected
null|Placeholder
$placeholder
$rotation
Rotation.
protected
int
$rotation
$shadow
Shadow.
protected
null|Shadow
$shadow
$width
Width.
protected
int
$width
$activeParagraph
Active paragraph.
private
int
$activeParagraph
= 0
$autoFit
Autofit.
private
string
$autoFit
= self::AUTOFIT_DEFAULT
$autoShrinkHorizontal
Horizontal Auto Shrink.
private
null|bool
$autoShrinkHorizontal
$autoShrinkVertical
Vertical Auto Shrink.
private
null|bool
$autoShrinkVertical
$border
Border.
private
Border
$border
$bottomInset
Bottom inset (in pixels).
private
float
$bottomInset
= 4.8
$columns
Number of columns (1 - 16).
private
int
$columns
= 1
$columnSpacing
The spacing between columns.
private
int
$columnSpacing
= 0
$fill
private
null|Fill
$fill
$fontScale
The percentage of the original font size to which the text is scaled.
private
null|float
$fontScale
$hashIndex
Hash index.
private
int
$hashIndex
$horizontalOverflow
Horizontal overflow.
private
string
$horizontalOverflow
= self::OVERFLOW_OVERFLOW
$leftInset
Left inset (in pixels).
private
float
$leftInset
= 9.6
$lnSpcReduction
The percentage of the reduction of the line spacing.
private
null|float
$lnSpcReduction
$richTextParagraphs
Rich text paragraphs.
private
array<string|int, Paragraph>
$richTextParagraphs
= []
$rightInset
Right inset (in pixels).
private
float
$rightInset
= 9.6
$topInset
Top inset (in pixels).
private
float
$topInset
= 4.8
$upright
Text upright?
private
bool
$upright
= false
$vertical
Vertical text?
private
bool
$vertical
= false
$verticalAlignCenter
Define vertical text center position into shape (center,not center).
private
int
$verticalAlignCenter
= self::VALIGN_NOTCENTER
$verticalOverflow
Vertical overflow.
private
string
$verticalOverflow
= self::OVERFLOW_OVERFLOW
$wrap
Text wrapping.
private
string
$wrap
= self::WRAP_SQUARE
Methods
__clone()
Magic Method : clone.
public
__clone() : mixed
__construct()
Create a new \PhpOffice\PhpPresentation\Shape\RichText instance.
public
__construct() : mixed
__toString()
Convert to string.
public
__toString() : string
Return values
stringaddText()
Add text.
public
addText([null|TextElementInterface $pText = null ]) : self
Parameters
- $pText : null|TextElementInterface = null
-
Rich text element
Return values
selfcreateBreak()
Create break.
public
createBreak() : BreakElement
Return values
BreakElementcreateParagraph()
Create paragraph.
public
createParagraph() : Paragraph
Return values
ParagraphcreateText()
Create text (can not be formatted !).
public
createText([string $pText = '' ]) : TextElement
Parameters
- $pText : string = ''
-
Text
Return values
TextElementcreateTextRun()
Create text run (can be formatted).
public
createTextRun([string $pText = '' ]) : Run
Parameters
- $pText : string = ''
-
Text
Return values
RungetActiveParagraph()
public
getActiveParagraph() : Paragraph
Return values
ParagraphgetActiveParagraphIndex()
Get active paragraph index.
public
getActiveParagraphIndex() : int
Return values
intgetAutoFit()
Get autofit.
public
getAutoFit() : string
Return values
stringgetBorder()
public
getBorder() : Border
Return values
BordergetColumns()
Get columns.
public
getColumns() : int
Return values
intgetColumnSpacing()
Get spacing between columns.
public
getColumnSpacing() : int
Return values
intgetContainer()
Get Container, Slide or Group.
public
getContainer() : ShapeContainerInterface|null
Return values
ShapeContainerInterface|nullgetFill()
public
getFill() : Fill|null
Return values
Fill|nullgetFontScale()
Get pourcentage of fontScale.
public
getFontScale() : float|null
Return values
float|nullgetHashCode()
Get hash code.
public
getHashCode() : string
Return values
string —Hash code
getHashIndex()
Get hash index.
public
getHashIndex() : null|int
Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.
Return values
null|int —Hash index
getHeight()
Get Height.
public
getHeight() : int
Return values
intgetHorizontalOverflow()
Get horizontal overflow.
public
getHorizontalOverflow() : string
Return values
stringgetHyperlink()
Get Hyperlink.
public
getHyperlink() : Hyperlink
Return values
HyperlinkgetInsetBottom()
Get bottom inset.
public
getInsetBottom() : float
Return values
floatgetInsetLeft()
Get left inset.
public
getInsetLeft() : float
Return values
floatgetInsetRight()
Get right inset.
public
getInsetRight() : float
Return values
floatgetInsetTop()
Get top inset.
public
getInsetTop() : float
Return values
floatgetLineSpaceReduction()
Get pourcentage of the line space reduction.
public
getLineSpaceReduction() : float|null
Return values
float|nullgetName()
Get Name.
public
getName() : string
Return values
stringgetOffsetX()
Get OffsetX.
public
getOffsetX() : int
Return values
intgetOffsetY()
Get OffsetY.
public
getOffsetY() : int
Return values
intgetParagraph()
Get paragraph.
public
getParagraph([int $index = 0 ]) : Paragraph
Parameters
- $index : int = 0
Return values
ParagraphgetParagraphs()
public
getParagraphs() : array<string|int, Paragraph>
Return values
array<string|int, Paragraph>getPlaceholder()
public
getPlaceholder() : Placeholder|null
Return values
Placeholder|nullgetPlainText()
Get plain text.
public
getPlainText() : string
Return values
stringgetRotation()
Get Rotation.
public
getRotation() : int
Return values
intgetShadow()
public
getShadow() : Shadow|null
Return values
Shadow|nullgetVerticalAlignCenter()
Get the vertical alignment center.
public
getVerticalAlignCenter() : int
Return values
intgetVerticalOverflow()
Get vertical overflow.
public
getVerticalOverflow() : string
Return values
stringgetWidth()
Get Width.
public
getWidth() : int
Return values
intgetWrap()
Get text wrapping.
public
getWrap() : string
Return values
stringhasAutoShrinkHorizontal()
public
hasAutoShrinkHorizontal() : bool|null
Return values
bool|nullhasAutoShrinkVertical()
Set vertical auto shrink.
public
hasAutoShrinkVertical() : bool|null
Return values
bool|nullhasHyperlink()
Has Hyperlink?
public
hasHyperlink() : bool
Return values
boolisPlaceholder()
public
isPlaceholder() : bool
Return values
boolisUpright()
Get upright.
public
isUpright() : bool
Return values
boolisVertical()
Get vertical.
public
isVertical() : bool
Return values
boolsetActiveParagraph()
Set active paragraph.
public
setActiveParagraph([int $index = 0 ]) : Paragraph
Parameters
- $index : int = 0
Return values
ParagraphsetAutoFit()
Set autofit.
public
setAutoFit([string $value = self::AUTOFIT_DEFAULT ][, float|null $fontScale = null ][, float|null $lnSpcReduction = null ]) : self
Parameters
- $value : string = self::AUTOFIT_DEFAULT
- $fontScale : float|null = null
- $lnSpcReduction : float|null = null
Return values
selfsetAutoShrinkHorizontal()
public
setAutoShrinkHorizontal([bool|null $value = null ]) : self
Parameters
- $value : bool|null = null
Return values
selfsetAutoShrinkVertical()
Set vertical auto shrink.
public
setAutoShrinkVertical([bool|null $value = null ]) : self
Parameters
- $value : bool|null = null
Return values
selfsetColumns()
Set columns.
public
setColumns([int $value = 1 ]) : self
Parameters
- $value : int = 1
Return values
selfsetColumnSpacing()
Set spacing between columns.
public
setColumnSpacing([int $value = 0 ]) : self
Parameters
- $value : int = 0
Return values
selfsetContainer()
Set Container, Slide or Group.
public
setContainer([ShapeContainerInterface|null $pValue = null ][, bool $pOverrideOld = false ]) : $this
Parameters
- $pValue : ShapeContainerInterface|null = null
- $pOverrideOld : bool = false
-
If a Slide has already been assigned, overwrite it and remove image from old Slide?
Return values
$thissetFill()
public
setFill([Fill|null $pValue = null ]) : self
Parameters
- $pValue : Fill|null = null
Return values
selfsetHashIndex()
Set hash index.
public
setHashIndex(int $value) : $this
Note that this index may vary during script execution! Only reliable moment is while doing a write of a workbook and when changes are not allowed.
Parameters
- $value : int
-
Hash index
Return values
$thissetHeight()
Set Height.
public
setHeight([int $pValue = 0 ]) : $this
Parameters
- $pValue : int = 0
Return values
$thissetHorizontalOverflow()
Set horizontal overflow.
public
setHorizontalOverflow([string $value = self::OVERFLOW_OVERFLOW ]) : self
Parameters
- $value : string = self::OVERFLOW_OVERFLOW
Return values
selfsetHyperlink()
Set Hyperlink.
public
setHyperlink([Hyperlink|null $pHyperlink = null ]) : self
Parameters
- $pHyperlink : Hyperlink|null = null
Return values
selfsetInsetBottom()
Set bottom inset.
public
setInsetBottom([float $value = 4.8 ]) : self
Parameters
- $value : float = 4.8
Return values
selfsetInsetLeft()
Set left inset.
public
setInsetLeft([float $value = 9.6 ]) : self
Parameters
- $value : float = 9.6
Return values
selfsetInsetRight()
Set left inset.
public
setInsetRight([float $value = 9.6 ]) : self
Parameters
- $value : float = 9.6
Return values
selfsetInsetTop()
Set top inset.
public
setInsetTop([float $value = 4.8 ]) : self
Parameters
- $value : float = 4.8
Return values
selfsetName()
Set Name.
public
setName([string $pValue = '' ]) : static
Parameters
- $pValue : string = ''
Return values
staticsetOffsetX()
Set OffsetX.
public
setOffsetX([int $pValue = 0 ]) : $this
Parameters
- $pValue : int = 0
Return values
$thissetOffsetY()
Set OffsetY.
public
setOffsetY([int $pValue = 0 ]) : $this
Parameters
- $pValue : int = 0
Return values
$thissetParagraphs()
Set paragraphs.
public
setParagraphs([array<string|int, Paragraph> $paragraphs = [] ]) : self
Parameters
- $paragraphs : array<string|int, Paragraph> = []
-
Array of paragraphs
Return values
selfsetPlaceHolder()
public
setPlaceHolder(Placeholder $placeholder) : self
Parameters
- $placeholder : Placeholder
Return values
selfsetRotation()
Set Rotation.
public
setRotation([int $pValue = 0 ]) : $this
Parameters
- $pValue : int = 0
Return values
$thissetShadow()
public
setShadow([Shadow|null $pValue = null ]) : $this
Parameters
- $pValue : Shadow|null = null
Return values
$thissetUpright()
Set vertical.
public
setUpright([bool $value = false ]) : self
Parameters
- $value : bool = false
Return values
selfsetVertical()
Set vertical.
public
setVertical([bool $value = false ]) : self
Parameters
- $value : bool = false
Return values
selfsetVerticalAlignCenter()
Define the vertical alignment if centered or not.
public
setVerticalAlignCenter(int $value) : self
Parameters
- $value : int
-
1=center 0=not
Tags
Return values
selfsetVerticalOverflow()
Set vertical overflow.
public
setVerticalOverflow([string $value = self::OVERFLOW_OVERFLOW ]) : self
Parameters
- $value : string = self::OVERFLOW_OVERFLOW
Return values
selfsetWidth()
Set Width.
public
setWidth([int $pValue = 0 ]) : $this
Parameters
- $pValue : int = 0
Return values
$thissetWidthAndHeight()
Set width and height with proportional resize.
public
setWidthAndHeight([int $width = 0 ][, int $height = 0 ]) : self
Parameters
- $width : int = 0
- $height : int = 0
Return values
selfsetWrap()
Set text wrapping.
public
setWrap([string $value = self::WRAP_SQUARE ]) : self
Parameters
- $value : string = self::WRAP_SQUARE