(Gast)
n/a Beiträge
|
Re: [PHP] Schriften bändigen
13. Jul 2007, 15:09
Ok, gelöst.
http://forum.de.selfhtml.org/archiv/2006/9/t136870/
Code:
$Char = chr ($a);
$Box = ImageTTFBBox ($Size, 0, $FontPath . $Font, $Char);
$yvar1 = $Box[5] > $Box[7] ? $Box[5] : $Box[7];
$yvar2 = $Box[1] < $Box[3] ? $Box[1] : $Box[3];
// Höhe und Breite des Schriftzeichens berechnen
$szheight = abs($yvar1 - $yvar2);
$szwidth = abs($Box[4] - $Box[0]);
$pos_x = round ($tmp_x + ($szwidth / 2) - $Box[6], 0);
$pos_y = round ($tmp_y - ($szheight / 2) - $Box[5], 0) - round ($szheight / 2);
|
|
Zitat
|