ComponentTextStyle
in package
implements
JsonSerializable
Detailed text styling options for components.
This class controls typography including fonts, colors, spacing, and alignment.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $backgroundColor : string|null
- $dropCapStyle : array<string|int, mixed>|null
- $firstLineIndent : int|null
- $fontName : string|null
- $fontSize : int|null
- $fontStyle : string|null
- $fontWeight : string|null
- $hangingPunctuation : int|null
- $hyphenation : bool|null
- $lineHeight : float|null
- $linkStyle : array<string|int, mixed>|null
- $paragraphSpacingAfter : int|null
- $paragraphSpacingBefore : int|null
- $textAlignment : string|null
- $textColor : string|null
- $textDecoration : string|null
- $textShadow : array<string|int, mixed>|null
- $textTransform : string|null
- $tracking : float|null
Methods
- jsonSerialize() : array<string, mixed>
- setBackgroundColor() : self
- Set background color for the text span.
- setDropCapStyle() : self
- Define the drop cap style for the first letter.
- setFirstLineIndent() : self
- Set the indentation of the first line.
- setFontName() : self
- Set the font family name.
- setFontSize() : self
- Set the font size in points.
- setFontStyle() : self
- Set font style (normal, italic).
- setFontWeight() : self
- Set font weight (e.g., "bold", "100").
- setHangingPunctuation() : self
- Control hanging punctuation (e.g., quotes outside the alignment).
- setHyphenation() : self
- Enable or disable automatic hyphenation.
- setLineHeight() : self
- Set the line height in points.
- setLinkStyle() : self
- Define styles for links within the text.
- setParagraphSpacingAfter() : self
- Set spacing after paragraphs.
- setParagraphSpacingBefore() : self
- Set spacing before paragraphs.
- setTextAlignment() : self
- Set text alignment (left, center, right, justify).
- setTextColor() : self
- Set the text color.
- setTextDecoration() : self
- Set text decoration (underline, line-through).
- setTextShadow() : self
- Apply a shadow effect to the text.
- setTextTransform() : self
- Set text transform (uppercase, lowercase, capitalize).
- setTracking() : self
- Set letter spacing (tracking).
Properties
$backgroundColor
private
string|null
$backgroundColor
= null
$dropCapStyle
private
array<string|int, mixed>|null
$dropCapStyle
= null
$firstLineIndent
private
int|null
$firstLineIndent
= null
$fontName
private
string|null
$fontName
= null
$fontSize
private
int|null
$fontSize
= null
$fontStyle
private
string|null
$fontStyle
= null
$fontWeight
private
string|null
$fontWeight
= null
$hangingPunctuation
private
int|null
$hangingPunctuation
= null
$hyphenation
private
bool|null
$hyphenation
= null
$lineHeight
private
float|null
$lineHeight
= null
$linkStyle
private
array<string|int, mixed>|null
$linkStyle
= null
$paragraphSpacingAfter
private
int|null
$paragraphSpacingAfter
= null
$paragraphSpacingBefore
private
int|null
$paragraphSpacingBefore
= null
$textAlignment
private
string|null
$textAlignment
= null
$textColor
private
string|null
$textColor
= null
$textDecoration
private
string|null
$textDecoration
= null
$textShadow
private
array<string|int, mixed>|null
$textShadow
= null
$textTransform
private
string|null
$textTransform
= null
$tracking
private
float|null
$tracking
= null
Methods
jsonSerialize()
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>setBackgroundColor()
Set background color for the text span.
public
setBackgroundColor(string $color) : self
Parameters
- $color : string
Return values
selfsetDropCapStyle()
Define the drop cap style for the first letter.
public
setDropCapStyle(array<string, mixed> $style) : self
Parameters
- $style : array<string, mixed>
Return values
selfsetFirstLineIndent()
Set the indentation of the first line.
public
setFirstLineIndent(int $indent) : self
Parameters
- $indent : int
Return values
selfsetFontName()
Set the font family name.
public
setFontName(string $fontName) : self
Parameters
- $fontName : string
Return values
selfsetFontSize()
Set the font size in points.
public
setFontSize(int $fontSize) : self
Parameters
- $fontSize : int
Return values
selfsetFontStyle()
Set font style (normal, italic).
public
setFontStyle(string $style) : self
Parameters
- $style : string
Return values
selfsetFontWeight()
Set font weight (e.g., "bold", "100").
public
setFontWeight(string $weight) : self
Parameters
- $weight : string
Return values
selfsetHangingPunctuation()
Control hanging punctuation (e.g., quotes outside the alignment).
public
setHangingPunctuation(int $value) : self
Parameters
- $value : int
Return values
selfsetHyphenation()
Enable or disable automatic hyphenation.
public
setHyphenation(bool $hyphenation) : self
Parameters
- $hyphenation : bool
Return values
selfsetLineHeight()
Set the line height in points.
public
setLineHeight(float $lineHeight) : self
Parameters
- $lineHeight : float
Return values
selfsetLinkStyle()
Define styles for links within the text.
public
setLinkStyle(array<string, mixed> $style) : self
Parameters
- $style : array<string, mixed>
Return values
selfsetParagraphSpacingAfter()
Set spacing after paragraphs.
public
setParagraphSpacingAfter(int $spacing) : self
Parameters
- $spacing : int
Return values
selfsetParagraphSpacingBefore()
Set spacing before paragraphs.
public
setParagraphSpacingBefore(int $spacing) : self
Parameters
- $spacing : int
Return values
selfsetTextAlignment()
Set text alignment (left, center, right, justify).
public
setTextAlignment(string $alignment) : self
Parameters
- $alignment : string
Return values
selfsetTextColor()
Set the text color.
public
setTextColor(string $color) : self
Parameters
- $color : string
Return values
selfsetTextDecoration()
Set text decoration (underline, line-through).
public
setTextDecoration(string $decoration) : self
Parameters
- $decoration : string
Return values
selfsetTextShadow()
Apply a shadow effect to the text.
public
setTextShadow(array<string, mixed> $shadow) : self
Parameters
- $shadow : array<string, mixed>
Return values
selfsetTextTransform()
Set text transform (uppercase, lowercase, capitalize).
public
setTextTransform(string $transform) : self
Parameters
- $transform : string
Return values
selfsetTracking()
Set letter spacing (tracking).
public
setTracking(float $tracking) : self
Parameters
- $tracking : float