Ver Mensaje Individual
  #16 (permalink)  
Antiguo 13/08/2008, 09:00
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 9 meses
Puntos: 2135
Respuesta: Generar imagen con texto + WORDWARP

Me alegra saber que si encontraste la fuente adecuada, espero puedas hacerlo, en PHP encontré esta función que hace algo mas o menos como lo que quieres:
Código PHP:
function imagettftextwrap($im$size$angle$x_pos$y_pos$color$font$instr)
{
    
$box = @imagettfbbox($size0$font$instr);
    
$width abs($box[4] - $box[0]);
    
$height abs($box[3] - $box[5]);
    
$overlap = (($x_pos $width) - imagesx($im));
    if(
$overlap 0//if the text doesn't fit on the image
    
{
        
$chars str_split($instr);
        
$str "";
        
$pstr "";
        for(
$m=0$m sizeof($chars); $m++)
        {
            
$bo imagettfbbox($fsize10$font1$str);
            
$wid abs($bo[4] - $bo[0]);
            if((
$x_pos1 $wid) < imagesx($im)) //add one char from the string as long as it's not overflowing
            
{
                
$pstr .= $chars[$m];
                
$bo2 imagettfbbox($fsize10$font1$pstr);
                
$wid2 abs($bo2[4] - $bo2[0]);
                if((
$x_pos1 $wid2) < imagesx($im))
                {
                    
$str .= $chars[$m];
                }   
                else
                {
                    break;
                }
            }
            else
            {
                break;
            }
        }
        
$restof "";
        for(
$l=$m$l sizeof($chars); $l++)
        {
            
$restof .= $chars[$l]; //add the rest of the string to a new line
        
}
        
imagettftext($im$size$angle$x_pos$y_pos$color$font$str); // print out the smaller line
        
imagettftext($im$size$angle0$y_pos $height$color$font$restof); //and the rest of it
    
}
    else
    {
        
imagettftext($im$size$angle$x_pos$y_pos$color$font$instr); //otherwise just do normally
    
}


Saludos.