Hey ginerjm
Outbounding box is the imaginary box that holds the text. It's what is used to determine the coordinates of the text box.
Unlike width, the height of the text is not simply $text_box_d[7] - $text_box_d[1] because the Y coordinates gets the height from the top of the image to the baseline of the text not to the top of the outbounding box.
This is the function used to print the text:
$x_co = ($imgWidth - $text_box_width) / 2;
$y_co = ($imgHeight - $text_box_height) / 2;
imagettftext($img, $font_size, 0, $x_co, $y_co, $text_color, $font, $string);
Width is calculated by getting the difference between $text_box_d['2'] and $text_box_d['0'] but the coordinates of the Y axis used for the height leads the text getting pushed upward not centered vertically due to, as stated above, the height is calculated from top of page to baseline of letters not the bounding box (top) of the letters
Thanks