Insert rich text
To mix multiple styles inside a single cell, build each fragment with \Vtiful\Kernel\RichString (which pairs a piece of text with a Format resource) and pass an array of those instances to insertRichText.
Function Prototype
\Vtiful\Kernel\RichString::__construct(string $text, ?resource $formatHandle = null)
insertRichText(int $row, int $column, array $runs, ?resource $formatHandle = null): selfstring $text
Text of one fragment.
resource $formatHandle
Style handle returned by
Format::toResource()for that fragment. Passnullto inherit the cell style.
int $row
cell row
int $column
cell column
array $runs
An array of
\Vtiful\Kernel\RichStringinstances, concatenated in order. Any element that is not aRichStringinstance will trigger an exception.
resource $formatHandle (optional)
Cell-level format (alignment, background, etc.) applied to the whole cell. Defaults to no style.
Example
Last updated