function textimage_measure_text_width in Textimage 7.2
Same name and namespace in other branches
- 5.2 textimage.module \textimage_measure_text_width()
- 5 textimage.module \textimage_measure_text_width()
- 6.2 textimage.module \textimage_measure_text_width()
Helper function for wrapping text (measures width).
1 call to textimage_measure_text_width()
- textimage_wrap_text in ./
textimage.utils.inc - Wrap text for rendering at a given width.
File
- ./
textimage.utils.inc, line 118 - Utility routines of Textimage.
Code
function textimage_measure_text_width($text, $fontsize, $font) {
$box = imagettfbbox($fontsize, 0, $font, $text);
return abs($box[4] - $box[0]) + 4;
}