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