CircularText()
mPDF ≥ 5.4
CircularText – Draw a circle using specified text
Description
function CircularText(
$x, $y, $r,
$text,
$align= 'top|bottom'
,
$fontfamily= ''
,
$fontsize= 0
,
$fontstyle= ''
,
$kerning= 120
,
$fontwidth = 100
,
$divider= ''
)
Draw a circle using specified text. One or both of top-text and/or bottom-text must be defined. The radius and font-size are user-defined, whilst the width and height of the generated object will be calculated from these values.
From mPDF ≥ 5.6 the CSS property font-size
can be set to auto
. This automatically
sizes text to fill a semicircle (if both top and bottom set) or a full circle (if only one set).
Circular Text is displayed as though an in-line element. Automatic kerning will be applied to the text if
useKerning
is true
.
Parameters
- $x
-
Abscissa of center
- $y
-
Ordinate of center
- $r
-
Radius of circle
- $text
-
Text to be printed
- $align
-
Text alignment:
'top'
or'bottom'
.Default:
'top'
$fontfamily
:
$fontsize
:
$fontstyle
:
- $kerning
-
(Fixed) spacing between letters in percentage.
Default value:
120
. Zero is not allowed.Uses automatic Kerning between letters if useKerning
= true
. - $fontwidth
-
Width of letters in percentage.
Default value:
100
. Zero is not allowed - $divider
-
Optional character string to divide top and bottom text
See Also
- For more details see <textcircle>