/** * Zeichnet die Textzeilen auf das Textbild. * * wie twMachTextzeilenForVorschaubild(), nur mit Startpunkt 0/0 und größer */ function twMachTextzeilenForTextbild($textbild) { // get-Variablen initialisieren $t1 = $_GET['t1']; // text aus Zeile 1 $t2 = $_GET['t2']; $t3 = $_GET['t3']; $t4 = $_GET['t4']; $t5 = $_GET['t5']; $f1 = $_GET['f1']; // Schriftart aus Zeile 1 $f2 = $_GET['f2']; $f3 = $_GET['f3']; $f4 = $_GET['f4']; $f5 = $_GET['f5']; $g1 = $_GET['g1']; // Schriftgröße aus Zeile 1 $g2 = $_GET['g2']; $g3 = $_GET['g3']; $g4 = $_GET['g4']; $g5 = $_GET['g5']; $c1 = $_GET['c1']; // Schriftfarbe aus Zeile 1 $c2 = $_GET['c2']; $c3 = $_GET['c3']; $c4 = $_GET['c4']; $c5 = $_GET['c5']; // Startpunkt $x1 = 0; $y1 = 0; // Schriftgrößen ($h) anhand der sgc(schriftGradCode) ermitteln $h1 = twFormatSchriftgroesse($g1) * 2; $h2 = twFormatSchriftgroesse($g2) * 2; $h3 = twFormatSchriftgroesse($g3) * 2; $h4 = twFormatSchriftgroesse($g4) * 2; $h5 = twFormatSchriftgroesse($g5) * 2; // die 5 Zeilen (jeweils vorher noch Schriftgröße abziehen wegen imagettftext()) $y1 = $y1 + $h1 + 12; twMachZeile($textbild, $c1, $h1, $x1, $y1, $f1, $t1); $y1 = $y1 + $h2 + 12; twMachZeile($textbild, $c2, $h2, $x1, $y1, $f2, $t2); $y1 = $y1 + $h3 + 12; twMachZeile($textbild, $c3, $h3, $x1, $y1, $f3, $t3); $y1 = $y1 + $h4 + 12; twMachZeile($textbild, $c4, $h4, $x1, $y1, $f4, $t4); $y1 = $y1 + $h5 + 12; twMachZeile($textbild, $c5, $h5, $x1, $y1, $f5, $t5); return $textbild; }
$h1 = twFormatSchriftgroesse($g1); $h2 = twFormatSchriftgroesse($g2); $h3 = twFormatSchriftgroesse($g3); $h4 = twFormatSchriftgroesse($g4); $h5 = twFormatSchriftgroesse($g5); // die 5 Zeilen (jeweils vorher noch Schriftgröße abziehen wegen imagettftext()) $y1 = $y1 + $h1 + 6; twMachZeile($bild, $c1, $h1, $x1, $y1, $f1, $t1); $y1 = $y1 + $h2 + 6; twMachZeile($bild, $c2, $h2, $x1, $y1, $f2, $t2); $y1 = $y1 + $h3 + 6; twMachZeile($bild, $c3, $h3, $x1, $y1, $f3, $t3); $y1 = $y1 + $h4 + 6; twMachZeile($bild, $c4, $h4, $x1, $y1, $f4, $t4); $y1 = $y1 + $h5 + 6; twMachZeile($bild, $c5, $h5, $x1, $y1, $f5, $t5); // Ausgabe des Bildes im Browser imagepng($bild, null, 100); // (mit null wirs nich gespeichert, nur ausgegeben) imagedestroy($bild); /* Funktionen --------------------------------------------------------------- */ function twMachZeile($bild, $textfarbe, $schriftgroesse, $x, $y, $f, $text) { // Textfarbe (noch von hex in rgb umwandeln) $arrFarbe = rgb2hex2rgb($textfarbe); $textfarbe = imagecolorallocate($bild, $arrFarbe[r], $arrFarbe[g], $arrFarbe[b]); // Schriftart ("/var/www/shirtbemaler/schriften/". $f. ".ttf";) $font = $_SESSION['dirDocumentRoot'] . $_SESSION['dirApplication'] . $_SESSION['dirFonts'] . $f . ".ttf"; if (!file_exists($font)) { $font = $_SESSION['dirDocumentRoot'] . $_SESSION['dirApplication'] . $_SESSION['dirFonts'] . "arial.ttf"; }