Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/04/2010, 13:36
totolia
 
Fecha de Ingreso: mayo-2008
Mensajes: 315
Antigüedad: 16 años
Puntos: 7
Respuesta: imagettftext(): Could not read font in...

Por si te interesa he conseguido hacer uno mio:

Código PHP:
<?php 

$banner 
"tu banner.png";
if(
eregi('.gif',$_REQUEST[ruta])) {
$fuente imagecreatefromgif($_REQUEST[ruta]);
}
elseif(
eregi('.jpeg',$_REQUEST[ruta])||eregi('.jpg',$_REQUEST[ruta])) {
$fuente imagecreatefromjpeg($_REQUEST[ruta]);
}
elseif(
eregi('.png',$_REQUEST[ruta])) {
$fuente imagecreatefrompng($_REQUEST[ruta]);
}
$watermark imagecreatefrompng('$banner');
$imgAncho imagesx ($fuente);
$imgAlto =imagesy($fuente);
$imagen ImageCreate($_REQUEST[ancho],$_REQUEST[alto]);
$naranja imagecolorallocate($imagen209209209);
$texto $_REQUEST['texto'];  
$dest_x $_REQUEST[ancho] - $_REQUEST[ancho] - 0;
$dest_y $_REQUEST[alto] - 33 0;
imagecopyresized($imagen$fuente0000$_REQUEST[ancho], $_REQUEST[alto], $imgAncho$imgAlto);
imagecopyresampled($imagen$watermark$dest_x$dest_y00,  $_REQUEST[ancho], 3363$_REQUEST[ancho]);
imagestring($imagen510$dest_y 5$texto$naranja);
if(
eregi('.gif',$_REQUEST[ruta])) {
Header("Content-type: image/gif");
imageGif($imagen);
}
elseif(
eregi('.jpeg',$_REQUEST[ruta])||eregi('.jpg',$_REQUEST[ruta])) {
Header("Content-type: image/jpeg");
imageJPEG($imagen);
}
elseif(
eregi('.png',$_REQUEST[ruta])) {
Header("Content-type: image/PNG");
imagePNG($imagen);
}


?>
Consta de un fondo que se envia con ruta=..., despues las medidas alto=, ancho=. Y despues el texto por texto=. Finalmente necesitamos una imagen que hace como de banner (es la variable $banner), que se pone encima la imagen con lo que el texto encima de ella. Un ejemplo:


Funciona en Gif, jpeg/jpg y png