mPDF Manual – mPDF functions


mPDF ≥ 5.4

CircularText – Draw a circle using specified text


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



Abscissa of center


Ordinate of center


Radius of circle


Text to be printed


Text alignment: 'top' or 'bottom'.

Default: 'top'








(Fixed) spacing between letters in percentage.

Default value: 120. Zero is not allowed.

Uses automatic Kerning between letters if useKerning = true.


Width of letters in percentage.

Default value: 100. Zero is not allowed


Optional character string to divide top and bottom text

See Also

Fork me on GitHub