heey,
het lukt allemaal om het om te zetten naar een img alleen hij toont het soms fout.
wij word en zo werkt het wel...
dit is mijn code:
ik hoop dat iemand mij kan helpen.
mvg jordy
het lukt allemaal om het om te zetten naar een img alleen hij toont het soms fout.
wij word en zo werkt het wel...
dit is mijn code:
PHP:
<?php
// Path to our font file
$font = "fonts/".$_GET['font'];
$size = $_GET['size'];
$text = $_GET['text'];
// First we create our bounding box for the first text
$bbox = imagettfbbox($size, 0, $font, $text);
//size img
$lengte = $bbox[2] - $bbox[0] + 20;
$hoogte = $bbox[1] - $bbox[7] + 15;
//echo "$lengte_o <br> $lengte_b <br> $hoogte_l <br> $hoogte_r <br>";
// Create a 300x150 image
$im = imagecreatetruecolor($lengte, $hoogte);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 171, 169, 167);
// Set the background to be white
imagefilledrectangle($im, 0, 0, 299, 299, $white);
// This is our cordinates for X and Y
$x = 10;
$y = $hoogte / 2 +8;
// Write it
imagettftext($im, $size, 0, $x, $y, $black, $font, $text);
// Output to browser
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
ik hoop dat iemand mij kan helpen.
mvg jordy